UNICODE string case-conversion
Steve Langasek
vorlon at netexpress.net
Mon Jan 31 04:31:57 GMT 2000
On Mon, 31 Jan 2000, Luke Kenneth Casson Leighton wrote:
> hey, this is probably more of an NT developer question than anything, but
> um... i need a strlowerW() function.
> i.e i need a UNICODE function that converts Unidode chatacters to lower
> case. firstly, does such a function exist, and does it work sensibly on
> russian etc alphabets, on NT?
For comparison, Wine has the internal functions towlower() and towupper(),
which operate on single characters. These are exposed in the API as
towlower/towupper in CRTDLL and apparently also in 'ntdll'.
Are WCHARs treated as fixed length in NT? If not, then there may not be an
equivalent string-oriented function because of buffer size problems. If they
are, strlowerW() would be easy enough to implement by calling towlower()
repeatedly.
The implementation can be found at http://www.winehq.com/source/misc/lstr.c;
as with ascii toupper()/tolower() in Unix, they're implemented by calling into
a table. http://www.winehq.com/source/include/casemap.h
In theory, the towlower() function found in glibc 2.1 could also be of use,
but the behavior of this function is governed by the current locale, so this
may not be a good choice for your your situation.
-Steve Langasek
postmodern programmer
More information about the samba-technical
mailing list