[Insight-developers] GDCM Compiler Warning: character set encoding

Sean McBride sean at rogue-research.com
Mon Aug 6 12:50:21 EDT 2007


On 8/6/07 2:59 PM, Mathieu Malaterre said:

>  I have been working quite a lot on this issue. Unfortunately I do
>not understand how this should be handle. As far as I understand this
>letter 'µ' can be encoded either as one char (value > 127 on ISO-xxx,
>typically on european keyboard), or on UTF (with two bytes). What does
>your locale says on your computer ?
>
>  If we cannot find a solution, I'll use what most other toolkit are
>using, replace 'µ' with ASCII only character ('Micro', 'u'...).

Sadly, it is very hard to use non-ASCII characters in source code,
especially in projects like ITK that need to support many platforms/compilers.

C99 supports a notation for "universal characters".  So for the 'micro
sign' you could write:

const char* myString = "It is 10 \u00B5m long";

The \u00B5 gives a "µ" and keeps your source file ASCII.

I'm not sure if C++ also supports this notation...

-- 
____________________________________________________________
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-developers mailing list