Character encoding in Comments

Moderators: cday, XnTriq, helmut, xnview, Dreamer

Valhal
Posts: 7
Joined: Sun May 07, 2017 3:28 am

Character encoding in Comments

Postby Valhal » Sun May 07, 2017 3:43 am

I have thousands of JPG files with comments in the file:comment field that use special Danish characters. I have XnViewMP installed on both a Windows 7 and a Macintosh machine. When I display the comments as info with the images in fullscreen the characters are shown correctly on the Windows machine, but on the Macintosh the special characters are garbled.

Both computers are set up with English as the default language, so I don't understand why XnViewMP behaves differently. I believe there ought to be a choice of encoding for the file:comment field like there is for the iptc:caption field, so that you can correctly display any comment field encodings independent from your computer setup. Is there any way for me to fix the problem with the current version of XnViewMP?

User avatar
xnview
Author of XnView
Posts: 27557
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Character encoding in Comments

Postby xnview » Tue May 16, 2017 2:12 pm

could you send me a jpg file, please?
Pierre.

Valhal
Posts: 7
Joined: Sun May 07, 2017 3:28 am

Re: Character encoding in Comments

Postby Valhal » Wed May 17, 2017 3:28 pm

Hi Pierre,

I attach a JPG image with Danish characters in the file:Comment field.

Valhal
Attachments
20160902-0936-P1150114.jpg

Valhal
Posts: 7
Joined: Sun May 07, 2017 3:28 am

Re: Character encoding in Comments

Postby Valhal » Wed May 24, 2017 3:09 pm

Can anybody help? I tried setting the locale on the Mac to en_us.iso8859-1 (was en_us.utf8), but it made no difference. It would be nice if XnViewMP could display the comments correctly regardless of the computer setup.
Thank you.
Valhal

User avatar
xnview
Author of XnView
Posts: 27557
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Character encoding in Comments

Postby xnview » Wed Jun 07, 2017 10:58 am

Valhal wrote:Can anybody help? I tried setting the locale on the Mac to en_us.iso8859-1 (was en_us.utf8), but it made no difference. It would be nice if XnViewMP could display the comments correctly regardless of the computer setup.
Thank you.
Valhal

you have not that?
Screen-2017-06-07_12-56-55.png


PS: There is no info in file:comment about encoding
Pierre.

Valhal
Posts: 7
Joined: Sun May 07, 2017 3:28 am

Re: Character encoding in Comments

Postby Valhal » Fri Jun 09, 2017 11:05 pm

Hi Pierre,

I don't understand your question. The picture only shows a small part of the file:comment. I attach one that shows the whole comment using Faststone in Windows 7. If there is no indication of the character encoding for file:comment then XnViewMP should determine the encoding from the text, if possible, like it is done by Notepad++. If it cannot determine the encoding I would suggest that the default guess should be ANSI. ISO 8859-1 is used a lot in Europe and should be easy to determine.

Thanks,

Carl
20160902-0936-P1150114-comment.jpg
Last edited by Valhal on Fri Jun 09, 2017 11:16 pm, edited 1 time in total.

Valhal
Posts: 7
Joined: Sun May 07, 2017 3:28 am

Re: Character encoding in Comments

Postby Valhal » Fri Jun 09, 2017 11:13 pm

Clarification:

On Windows XnViewMP displays the comment like Faststone does. On the Mac, however, the comment is shown like it is on Windows in Exiftool GUI with the special characters garbled:

20160902-0936-P1150114-comment-exiftool.jpg

User avatar
xnview
Author of XnView
Posts: 27557
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Character encoding in Comments

Postby xnview » Sat Jun 10, 2017 12:21 pm

Valhal wrote:On Windows XnViewMP displays the comment like Faststone does. On the Mac, however, the comment is shown like it is on Windows in Exiftool GUI with the special characters garbled:

Strange please check my screenshot, the comment is not like that...
Pierre.

Valhal
Posts: 7
Joined: Sun May 07, 2017 3:28 am

Re: Character encoding in Comments

Postby Valhal » Sat Jun 10, 2017 4:49 pm

Hi Pierre,

I don't know if your screenshot is made on a Mac and which program you are using. The fact that XnViewMP displays the comment differently on different computers indicates that there is a problem. XnViewMP should display the comment correctly independent of the type of computer and the computer setup.

I tried the XnViewMP SetComment function on Windows, and more problems arise. The Setcomment window looks like this:

20160902-0936-P1150114-xnviewmp-setcomment.jpg
20160902-0936-P1150114-xnviewmp-setcomment.jpg (50.81 KiB) Viewed 109 times


When I replace the second garbled character with the Danish character æ, and write the file, I get the following comment displayed by XnViewMP as well as by Faststone:

Vi tager afsked med Thomas. Han er t�mrer/snedker og arbejder stadig i sit værksted. Hans sidste v�rk er denne paddel lavet af det eftertragtede hawaiianske koa tr�.

The first garbled character was an ø and the next three were æ. You now see that the first æ is correctly encoded in UTF-8 whereas the ø and the last two æ's have been encoded as the garbled character.

XnViewMP cannot assume that the comment is encoded in UTF-8. There needs to be a setting in XnViewMP so that the user can tell the program what the encoding of the comment field is. That would be better and easier to implement than my previous suggestion that XnViewMP try to determine the encoding from the text, which can be impossible for short comments.

Thank you.

Carl

User avatar
xnview
Author of XnView
Posts: 27557
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Character encoding in Comments

Postby xnview » Sat Jun 10, 2017 6:27 pm

Valhal wrote:I don't know if your screenshot is made on a Mac

yes on mac, and no problem

XnViewMP cannot assume that the comment is encoded in UTF-8. There needs to be a setting in XnViewMP so that the user can tell the program what the encoding of the comment field is. That would be better and easier to implement than my previous suggestion that XnViewMP try to determine the encoding from the text, which can be impossible for short comments.

i'll add a settings for comment encoding
Pierre.

User avatar
XnTriq
Moderator & Librarian
Posts: 4949
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Character encoding in Comments

Postby XnTriq » Sat Jun 10, 2017 7:45 pm

Dunno if that's relevant: On Windows, all Dano-Norwegian letters are displayed correctly in MP's IPTC-IIM tab and Edit IPTC/XMP dialog after copying the JPEG comment to IPTC caption with XnView Classic's cmd_CopyCommentIntoCaption command.

Valhal
Posts: 7
Joined: Sun May 07, 2017 3:28 am

Re: Character encoding in Comments

Postby Valhal » Sun Jun 11, 2017 7:15 pm

Pierre wrote:
i'll add a settings for comment encoding


Thank you. That would be the best solution.

Xntriq: Copying all the comments to the IPTC field can also be done with exiftool, but it would be a lot of work for the 30,000 files that I have. And besides, it would be better to improve XnViewMP so that it can correctly display the comment for different encodings of the comment field.

Valhal

User avatar
XnTriq
Moderator & Librarian
Posts: 4949
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Character encoding in Comments

Postby XnTriq » Sun Jun 11, 2017 8:15 pm

Valhal wrote:Xntriq: Copying all the comments to the IPTC field can also be done with exiftool, but it would be a lot of work for the 30,000 files that I have. And besides, it would be better to improve XnViewMP so that it can correctly display the comment for different encodings of the comment field.

Yes, I absolutely agree, Valhal (-:

User avatar
xnview
Author of XnView
Posts: 27557
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Character encoding in Comments

Postby xnview » Sat Jun 17, 2017 5:02 pm

Issue 1235 is fixed in next version.
Pierre.

User avatar
xnview
Author of XnView
Posts: 27557
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Character encoding in Comments

Postby xnview » Sat Jul 08, 2017 12:54 pm

This problem is supposed to be fixed in XnView MP 0.87. Please check and confirm the bug fix here.
Pierre.


Return to “0.87 Testing – Retest (Fixed in Beta 1)”

Who is online

Users browsing this forum: No registered users and 0 guests