ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: yougene on February 10, 2017, 05:11:22 AM

Title: XMP Tags, windows and umlauts problems
Post by: yougene on February 10, 2017, 05:11:22 AM
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.



Title: Re: XMP Tags, windows and umlauts problems
Post by: Hayo Baan on February 10, 2017, 07:45:13 AM
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
Title: Re: XMP Tags, windows and umlauts problems
Post by: Phil Harvey on February 10, 2017, 08:00:30 AM
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
Title: Re: XMP Tags, windows and umlauts problems
Post by: Hayo Baan on February 10, 2017, 10:29:28 AM
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 ;)
Title: Re: XMP Tags, windows and umlauts problems
Post by: yougene on February 11, 2017, 05:23:09 AM
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.

Title: Re: XMP Tags, windows and umlauts problems
Post by: Hayo Baan on February 11, 2017, 05:35:33 AM
Can you upload the arg file so we can see if it is properly encoded?
Title: Re: XMP Tags, windows and umlauts problems
Post by: yougene on February 11, 2017, 05:46:05 AM
Sure thing. There you go.
Title: Re: XMP Tags, windows and umlauts problems
Post by: ryerman on February 11, 2017, 08:37:48 AM
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öü
Title: Re: XMP Tags, windows and umlauts problems
Post by: yougene on February 12, 2017, 04:31:49 AM
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!