XMP Tags, windows and umlauts problems

Started by yougene, February 10, 2017, 05:11:22 AM

Previous topic - Next topic

yougene

Hi all,

I'm encountering a problem when writing xmp tags on windows. Windows version is 10, cmd charset is cp850.

C:\Users\Stett>chcp
Aktive Codepage: 850.



When specifying no extra charset option umlauts show up as questionmarks:

C:\Users\Stett>exiftool -xmp:Title="ÄÖÜßtest" c:/Test/testbild.jpg
    1 image files updated

C:\Users\Stett>exiftool -xmp:Title c:/Test/testbild.jpg
Title                           : ????test


Using charset options as paramteter doesn't solve it (cp850, isnt't a valid charset??):

C:\Users\Stett>exiftool -charset cp850 -xmp:Title="ÄÖÜßtest" c:/Test/testbild.jpg
Invalid Charset cp850
    1 image files updated

C:\Users\Stett>exiftool -xmp:Title c:/Test/testbild.jpg
Title                           : ????test



Changing the charset in windows cmd doesn't help either:

C:\Users\Stett>chcp 65001
Aktive Codepage: 65001.

C:\Users\Stett>exiftool -xmp:Title="ÄÖÜßtest" c:/Test/testbild.jpg
    1 image files updated

C:\Users\Stett>exiftool -xmp:Title c:/Test/testbild.jpg
Title                           : ????test



I tested with the exactly same files and commands on a linux machine and there it worked flawless. Where would I go from here? Any help is much appreciated.




Hayo Baan

Sigh, always these character code problems. I wish Microsoft would change to UTF8 like the rest of the world.

Anyway, -charset cp850 indeed isn't supported by exiftool (@Phil, why not?), try cp1252 instead. Make sure you set that codepage in Windows as well (though I think it actually is the default).

Hope this helps,
Hayo
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

Displaying special characters in Windows is tricky, but I don't understand why your test with UTF-8 didn't work given that the characters showed up properly on your command line.  If the were truly UTF-8, than this should have worked.  Maybe try starting with a file that you know is written correctly and seeing if you can get the output to display correctly.  Also you could try piping to/from files and use a UTF-8 aware text editor to view/edit the values:

exiftool "-xmp:title<in.txt" c:/Test/testbild.jpg

exiftool -xmp:title c:/Test/testbild.jpg > out.txt

@Hayo: I don't recall ever having any requests to support the old DOS code pages.  Adding support for all of these would be a fair bit of work.

- 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 ($).

Hayo Baan

Quote from: Phil Harvey on February 10, 2017, 08:00:30 AM
@Hayo: I don't recall ever having any requests to support the old DOS code pages.  Adding support for all of these would be a fair bit of work.

If it's a lot of work (i.e. more than simply adding it to e.g a list), than forget it; cp850 is indeed an archaic codepage ;)
Hayo Baan – Photography
Web: www.hayobaan.nl

yougene

Thank you for your suggestions. Piping was a good hint, still it doesn't work correctly.

What I tried was creating a utf8 file in notepad++ and using it as input for the exiftool arguments like so:

C:\Users\Stett>exiftool -xmp:All= "c:\Test\testbild.jpg"
    1 image files updated

C:\Users\Stett>exiftool -@ "c:\Temp\ExifTool\MetaTest.arg" -common_args "c:\Test\testbild.jpg"
    1 image files updated

C:\Users\Stett>exiftool -xmp:All "c:\Test\testbild.jpg"
XMP Toolkit                     : Image::ExifTool 10.38
Title                           : awfwfawf├Â├╝


Content of  MetaTest.arg is:

-xmp:Title=awfwfawföü

Why wouldn't this work, as the windows cmd doesn't handle any character encoding anymore in this case? I'm at my wits end here.


Hayo Baan

Can you upload the arg file so we can see if it is properly encoded?
Hayo Baan – Photography
Web: www.hayobaan.nl

yougene

Sure thing. There you go.

ryerman

You forgot to change the code page for the command window.

C:\WINDOWS\system32>exiftool -xmp:All= "W:\Test\file.jpg"
    0 image files updated
    1 image files unchanged

C:\WINDOWS\system32>exiftool -@ "W:\Test\MetaTest.arg" "W:\Test\file.jpg"
    1 image files updated

C:\WINDOWS\system32>exiftool -xmp:All "W:\Test\file.jpg"
XMP Toolkit                     : Image::ExifTool 10.37
Title                           : awfwfawf├Â├╝

C:\WINDOWS\system32>chcp 65001
Active code page: 65001

C:\WINDOWS\system32>exiftool -xmp:All "W:\Test\file.jpg"
XMP Toolkit                     : Image::ExifTool 10.37
Title                           : awfwfawföü
Windows 10 Home 64 bit, Exiftool v12.61

yougene

Thank you for taking the time to recreate the problem and pointing out my mistake.

Now it works fine, just as intended.

Unbelievable how Microsoft keeps hanging on to standards from the 80s despite the whole rest of the tech world has long moved on.


Thanks again to all of you for the quick and competent help!