Page 1 of 1

Caption error with french accent

Posted: 2013-04-03T15:12:52-07:00
by zakdo
Hi!

I am getting wrong output character when using caption with french accent. Example:

Code: Select all

@ECHO OFF
  convert -background lightblue -fill blue -gravity center  ^
          -font "C:\Windows\Fonts\timesbd.ttf"  ^
          -size 292x208   caption:"Test With accent â ù é"  ^
           C:\Users\ZAK\Desktop\output.gif
results in:
Image

(note we don't have "â ù é")

my convert version is:

Code: Select all

C:\Users\ZAK>convert --version
Version: ImageMagick 6.8.4-6 2013-04-01 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms lzma pango png ps tiff x
xml zlib
Thx

Re: Caption error with french accent

Posted: 2013-04-03T15:23:24-07:00
by magick
Convert your text to UTF8 and make sure your font supports UTF8 encoding. We standardized on UTF8 because its supported both under Linux and Windows.

Re: Caption error with french accent

Posted: 2013-04-03T17:49:54-07:00
by snibgo
I find the Windows command processor usually mucks up commands containing UTF-8 text. I'm sure there is a workaround, but I don't know what it is.

Instead, I put the text in a file, saved as UTF-8, and "@" caption. Thus ...

Code: Select all

"%IMG%convert" -background lightblue -fill blue -gravity center  ^
          -font "C:\Windows\Fonts\timesbd.ttf"  ^
          -size 292x208   caption:@capt.txt  ^
           output.gif
... where capt.txt is a text file, saved with Notepad as UTF-8, containing:

Code: Select all

Test With accent â ù é

Re: Caption error with french accent

Posted: 2013-04-04T17:02:34-07:00
by anthony
Future...

In IMv7, the "magick" scripting will should not muck up UTF-8.

Using "magick" scripting should make IM scripts more portible between all machines as it avoids DOS or Shell script interpretations.

However there are quite a number of things that still needs to be added to make "magick-scripting" useful, such as script argument handling.

Re: Caption error with french accent

Posted: 2013-04-22T06:09:25-07:00
by zakdo
Hi,
I solved my problem by using "chcp 1252" in DOS for converting to ANSI character :

Code: Select all

    @ECHO OFF
    chcp 1252
      convert -background lightblue -fill blue -gravity center  ^
              -font "C:\Windows\Fonts\timesbd.ttf"  ^
              -size 292x208   caption:"Test With accent â ù é"  ^
               C:\Users\ZAK\Desktop\output.gif
Thanks