[Insight-users] Using ITK with unicode character set

Sean McBride sean at rogue-research.com
Tue Jul 3 09:35:51 EDT 2007


On 7/3/07 10:04 AM, Sébastien Fricker said:

>I assume that because char type is too small to hold Unicode encoding so I
>need to use wchar_t.

This assumption is incorrect.  I really suggest you read:
<http://www.joelonsoftware.com/articles/Unicode.html>

char* is perfectly fine for a unicode string that is encoded as UTF8.

>In windows you can use TCHAR macro, which is replaced
>by char or wchar_t whether you need Unicode or not.

Ah, I see, thanks for the explanation.

>So right know I want to pass a wchar_t* to SetFileName, but SetFileName
>apparently only takes a char*. The only solution I found was to make a
>conversion but it's clumsy so I wanted to know if there was another way.

After reading the above article, the question you should ask (and I
don't know the answer) is "What encoding does ITK's SetFileName() expect?".

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the Insight-users mailing list