How do you guys pass UTF-8 parameters in a DOS call?

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
alexeiramone

How do you guys pass UTF-8 parameters in a DOS call?

Post by alexeiramone »

I never managed to make this work.. I need to call the executables and convert unicode parameters. If I pass the string "Some Brazilian word like coração" it crops the text right before the ç. The reason is convert uses UTF8 and dos use codepages. How do I make this work?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: How do you guys pass UTF-8 parameters in a DOS call?

Post by magick »

What version of ImageMagick are you using? The current release is ImageMagick 6.6.0-7 and has a patch to accept non-UTF-8 text.
alexeiramone

Re: How do you guys pass UTF-8 parameters in a DOS call?

Post by alexeiramone »

Hmmmmmmmmm i didn't see that in docs.... i tried with an older version but i just downloaded a new one this week. Lemme retry.
alexeiramone

Re: How do you guys pass UTF-8 parameters in a DOS call?

Post by alexeiramone »

OH great. This new version hangs, it's not working anymore, even calling convert from DOS it simply hangs. Windows Server 2003 Standard SP1.

Here's the command that used to work...

convert background red -fill black -font arial -kerning -1 -size 190x146 -pointsize 18 -interline-spacing -2 caption:"Créu" "C:\folder\whatever\magick.png"
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do you guys pass UTF-8 parameters in a DOS call?

Post by fmw42 »

convert background red -fill black -font arial -kerning -1 -size 190x146 -pointsize 18 -interline-spacing -2 caption:"Créu"
You left off the minus sign before -background

convert -background red -fill black -font arial -kerning -1 -size 190x146 -pointsize 18 -interline-spacing -2 caption:"Créu" tmp.png

works fine for me in IM 6.6.0-7 Q16 Mac OSX Tiger
alexeiramone

Re: How do you guys pass UTF-8 parameters in a DOS call?

Post by alexeiramone »

Sorry about the minus sign i forgot, just a copy+paste issue but thanks for pointing that out :-)

This WORKS
convert -background red -fill black -font arial -kerning -1 -size 190x146 -pointsize 18 -interline-spacing -2 caption:Test test.png

THIS DOESN'T (HANGS)
convert -background red -fill black -font arial -kerning -1 -size 190x146 -pointsize 18 -interline-spacing -2 caption:Ação test.png

I didn't find the Patch you talked about.... plus, it's not supposed to HANG just because you have a different character
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do you guys pass UTF-8 parameters in a DOS call?

Post by fmw42 »

convert -background red -fill black -font arial -kerning -1 -size 190x146 -pointsize 18 -interline-spacing -2 caption:Ação tmp.png

works just fine for me. What version of IM are you using?


see http://www.imagemagick.org/script/binar ... hp#windows
alexeiramone

Re: How do you guys pass UTF-8 parameters in a DOS call?

Post by alexeiramone »

The very latest, I just downloaded it today.

C:\>convert -version
Version: ImageMagick 6.6.0-7 2010-03-16 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP

Windows 2003 standard SP1

Thanks in advance
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do you guys pass UTF-8 parameters in a DOS call?

Post by fmw42 »

OK. Sounds like a possible bug (or faulty install) in the Windows version of this release. Suggest you post a note to the bugs forum and refer back to this topic.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do you guys pass UTF-8 parameters in a DOS call?

Post by fmw42 »

one last thing to try. try putting your text in quotes or double quotes

onvert -background red -fill black -font arial -kerning -1 -size 190x146 -pointsize 18 -interline-spacing -2 caption:"Ação" tmp.png

see if that makes a difference
alexeiramone

Re: How do you guys pass UTF-8 parameters in a DOS call?

Post by alexeiramone »

No, i didn't work. I'll move this to the BUG section, thanks for the help.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: How do you guys pass UTF-8 parameters in a DOS call?

Post by magick »

We can reproduce the problem and will have a patch in ImageMagick 6.6.0-8 Beta within a day or two. Thanks.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do you guys pass UTF-8 parameters in a DOS call?

Post by fmw42 »

Withdrawn as Magick has confirmed the bug
Post Reply