[Insight-users] Using ITK with unicode character set

Sébastien Fricker sebastien.fricker at phaseview.net
Tue Jul 3 04:04:11 EDT 2007


I assume that because char type is too small to hold Unicode encoding so I
need to use wchar_t. In windows you can use TCHAR macro, which is replaced
by char or wchar_t whether you need Unicode or not.

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.

Thanks for your time.

Sebastien Fricker

-----Original Message-----
From: Sean McBride [mailto:sean at rogue-research.com] 
Sent: vendredi 29 juin 2007 19:12
To: Sébastien Fricker; insight-users at itk.org
Subject: Re: [Insight-users] Using ITK with unicode character set

On 6/28/07 1:28 PM, Sébastien Fricker said:

>Is it possible to use ITK with unicode character set?
>
>Currently I installed ITK and use it with Visual Studio 8.
>
> 
>
>I use the following function:
>
>Itk:ImageFileReader::SetFileName(const char* _arg), where _arg uses ASCII
>character set.

Why do you assume that?  Of course, you have to assume something because
the ITK documentation does not say which character encoding to pass (it
really really should, please file a bug)!  Which character encodings
have you tried?  Just because it it typed as 'char*' does _not_ mean it
expects ASCII.

>ITK does not seem to provide the TCHAR mechanism for Unicode compatibility.

Never heard of TCHAR, sorry....

-- 
____________________________________________________________
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