Page 1 of 1

IM 6.7.9-Q16 draw text with accented chars in Windows .bat

Posted: 2013-09-23T06:36:49-07:00
by juef
Greetings,

I am trying to append some text to an image using ImageMagick's convert and draw. I use the following command:

Code: Select all

convert  -draw "text 0,0 'Écolière'" -font arial-unicode.ttf 1.png 2.png
When used in Ubuntu, or when used in Windows and typed directly into the command line prompt, the desired output is produced perfectly. However, putting the command in a batch file produces garbage characters instead of the 'É', 'è' and such. I have tried changing the batch file's encoding to ANSI, UTF-8, and basically every other encoding Notepad++ offers but with no success. I also tried changing the EOF to UNIX style, which unfortunately didn't work.

Is there any way to use these special characters in a Windows batch file?

Thank you for your time and please have a nice day!

Re: IM 6.7.9-Q16 draw text with accented chars in Windows .b

Posted: 2013-09-23T07:00:15-07:00
by dlemstra
Have you tried a newer version of ImageMagick? Your version is almost a year old.

Re: IM 6.7.9-Q16 draw text with accented chars in Windows .b

Posted: 2013-09-23T08:02:15-07:00
by juef
Thank you for your reply!

I had not realized that 6.7.9 was so old, sorry. I just tried with 6.8.6-10-Q16-x86-dll and the results are the same.

Re: IM 6.7.9-Q16 draw text with accented chars in Windows .b

Posted: 2013-09-23T11:11:25-07:00
by snibgo
Try

Code: Select all

chcp 1252
before your convert command.

Re: IM 6.7.9-Q16 draw text with accented chars in Windows .b

Posted: 2013-09-23T12:45:45-07:00
by juef
That does work, thank you! Apparently the default code page on my system is 850, which is 'Multilingual (Latin I)', identified by 'OEM 850' in Notepad++. That code page does support accented characters, but apparently not with the same codes.

I would have never found that by myself, so thanks again very much!