Cant save russian symbols in IPTC:Caption-Abstract in UTF-8

Started by илдар, July 20, 2015, 12:12:47 AM

Previous topic - Next topic

илдар

I wrote UTF8 batch file:

chcp 65001
exiftool.exe -all= D:\blue_album\0002.jpg
exiftool.exe -IPTC:Caption-Abstract="123 russian й 456" D:\blue_album\0002.jpg

I get log
Quote
D:\blue_album>exiftool.exe -all= D:\blue_album\0002.jpg
    1 image files updated

D:\blue_album>exiftool.exe -IPTC:Caption-Abstract="123 russian й 456" D:\blue_al
bum\0002.jpg
Warning: Malformed UTF-8 character(s) - D:/blue_album/0002.jpg
    1 image files updated

And in the IPTC:Caption-Abstract field contain after this only "123 russian" phrase.

How I can write russian symbols in UTF-8 in this field?

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

илдар

anyway, problem exists.
Yes, I changed command to

exiftool.exe -IPTC:Caption-Abstract="123 russian й 456" -IPTC:codedcharacterset=utf8 -charset iptc=utf8 D:\blue_album\0002.jpg


, and it completes successfully, but really, file 0002.jpg contain the phrase in windows-1251 codepage!

Phil Harvey

When you use UTF-8 for IPTC and don't specify an external character set for ExifTool, then no character translations are done (because ExifTool assumes UTF-8 input by default).  So if you're not getting what you want in the IPTC, it is because you are not providing UTF-8.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

илдар

I have no idea how to provide utf8 to input.
I tried two cases:
1. I used batch file, it is already in utf8 (see attached screenshot)
2. I used input text for command from utf8 text file (like in 18 FAQ):

exiftool.exe -charset iptc=utf8 -charset exiftool=utf8 -IPTC:codedcharacterset=utf8 -IPTC:Caption-Abstract<=lala2.txt D:\blue_album\0002.jpg

, where lala2.txt - is utf8 text file, containing "123 russian й arabic ش tatar ә 456"

In both cases I get windows-1251 coded string in jpg-file. ("123 russian й arabic ? tatar ? 456")

Can you help me?

Phil Harvey

Quote from: илдар on July 24, 2015, 12:06:57 AM

exiftool.exe -charset iptc=utf8 -charset exiftool=utf8 -IPTC:codedcharacterset=utf8 -IPTC:Caption-Abstract<=lala2.txt D:\blue_album\0002.jpg

I don't understand why you don't need to put quotes around the argument containing the "<" symbol.

Could you post the "lala2.txt" file please?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

илдар