Locales, character sets, and wctype functions

Jonathan Duddington jsd at clara.co.uk
Sat Mar 31 17:20:39 UTC 2007


This probably isn't the best place to ask this programming question,
but perhaps someone knows the answer, or else suggest a better place to
ask.

The eSpeak program processes text from different languages with
different character sets.  Internally, it uses unicode.  When
processing text, it calls "wctype" functions such as iswalpha(), which
checks whether a unicode character is alphabetic, and towlower() to
convert to lower case.

Some people report that this doesn't work on their computers.

iswalpha() only works for unicode characters after I call
setlocale(LC_TYPE,locale) with a locale name such as "en_US.uft8". 
This tells iswalpha() etc that I'm using unicode.

But some people don't have locale "en_US.utf8" installed on their
computer.

So how do I explicitly tell the wctype functions that I'm using unicode
character codes, so that they gives me the correct result?





More information about the Ubuntu-accessibility mailing list