EXIF Chinese / Japanese Characters

Started by Ray, May 06, 2014, 07:10:33 AM

Previous topic - Next topic

Ray

Hi Phil,

I tried using Exiftool to update the EXIF UserComment field of my NEF files with Chinese or Japanese characters but no success.  Can you please help?

I use English Windows command prompt with input CSV file in UTF8 format.  Even though I executed the command "chcp 65001" before running Exiftool, the UserComment field still could be updated correctly.

Many thanks!

Ray

Phil Harvey

Hi Ray,

If you are inputting from a CSV file, then the console character set doesn't matter, and this should have worked because ExifTool expects UTF-8 by default.  If this is the case, then the value was probably written correctly.  What makes you think it wasn't?  I suspect that it is the reading back of the value that is the problem.  Try "exiftool FILE > out.txt", then look at out.txt with a UTF-8 capable text editor.

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

Ray

Hi Phil,

Thanks for the reply.

Yes, when I checked the out.txt as you suggested, I can see the comment there :)   However, when I view the NEF using ExifToolGUI or IrfanView, the characters cannot be displayed correctly!  I recall you said that EXIF uses ASCII.  Perhaps that's the issue!

Actually I want to put the UserComment as watermark when generating the JPG, but apparently IrfanView expects it should be ASCII and not UTF-8?  Any idea what other tool can do this?

Thanks again.

Ray

Phil Harvey

Hi Ray,

The EXIF UserComment is stored as UCS-2 Unicode, so it supports special characters (as long as they can be represented by UCS-2).  So perhaps it is an ExifToolGUI/IrfanView problem displaying them?  I'm not an expert on other applications, so I can't help much with this.

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

Ray

Hi Phil,

I also tried Nikon ViewNX2 and again the characters cannot be displayed correctly.

Alternatively, is it possible to use exiftool to update the UserComment in ASCII or UCS-2?

Thanks,
Ray

Phil Harvey

Hi Ray,

ExifTool writes EXIF:UserComment in UCS-2 if it contains special characters, otherwise in ASCII.  See FAQ 10 for details.

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

Ray

Hi Phil,

According to FAQ 10, Chinese or Japanese is not in the list of valid CHARSET.  Does it mean that actually Chinese or Japanese is not supported?

Thanks.

Ray

Phil Harvey

Hi Ray,

No.  The characters in all languages are supported by UTF-8, which is the default character set for the ExifTool user interface.

You may have a problem if the code points are above U+FFFF though, because this would exceed the maximum for the UCS-2 encoding of UserComment.

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

Ray

Hi Phil,

Is the EXIF UserComment encoding of NEF and JPG different?  I tried different viewers and finally found that only ViewNX2 can display the characters of JPG generated by Exiftool.  However, there is still problem with NEF files.  Any idea why it only works for JPG but not NEF?

Thanks,

Ray

Phil Harvey

Interesting.  The EXIF encoding technique for EXIF UserComment is identical for both JPEG and NEF, so I don't understand the difference you are seeing.

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