dcmodify - special national characters lost

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
micdob89
Posts: 6
Joined: Mon, 2015-02-02, 11:40

dcmodify - special national characters lost

#1 Post by micdob89 »

Hello All,

The problem that I have encountered recently occured under below circumstances:

Environment:
OS: Windows 10 Pro
System locale settings: Polish
dcmtk version: 3.6.2 and 3.6.0
dcmodify.exe started via cmd.exe

Test data:
Sample dicom file of DX modality
0008,0005 = ISO_IR 101

I have following problem:

When trying to modify (0008,1030) tag and set it's value to "śnieżny opis", only "nieżny opis" can be seen in output dicom file. I tried executing chcp 1250 and chcp 65001 before executing dcmodify to adjust codepage of cmd.exe, unfortunately it didn't help. The other polish national characters that are lost after using dcmodify are: ą, ź.
For me it looks like some charset/encoding conversion problem. Probably more like encoding because I noticed that tags' output values depend on the place where 'ś' or 'ź' is used- sometimes 'ś' or 'ź' is skipped and sometimes it's becoming some unreadable character. Command that I use for testing:

dcmodify.exe -i "(0008,1030)=śnieżny opis" "1.dcm"

I would appreciate any suggestions. Thank you.

Greetings
Michal

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: dcmodify - special national characters lost

#2 Post by Michael Onken »

Hi,

we also had problems when playing around with the Windows Code Page settings on the command line.

Maybe you can first check whether it's actually a code page problem. I would use an editor and put the desired name value into a text file, using the desired character set. Then use dcmodify's -if (insert from file) option to insert the name value via the text file. In order to check what is in the resulting file, use dcmdump and redirect output to a file, e.g. dcmdump new_file.dcm > output.txt. Check the text output file in your editor again (with correct character set enabled in editor).

If this works without problems, the problem is "just" the command line character set input or ouptut.

Best,
Michael

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest