Nonstandard capitilization

2000-11-10 Thread Aric Stewart

Hello,

  Working with internationalization i have run into a bug and was
wondering what people though a good approach would be.

  The basic problem is that turkish has nonstandard capitalization. 

I have been told:

Turkish character set (codepage 1254, ISO8859-9) distinguishes i with a 
dot above and i without a dot.  So it is correct that toupper('i') returns
0xDD.

  uppercase i without a dot: 0x49 (=I)
  lowercase i without a dot: 0xFD
  uppercase i with a dot:0xDD
  lowercase i with a dot:0x69 (=i)

cf.  http://czyborra.com/charsets/iso8859.html#ISO-8859-9

But LCMapString(LCMAP_LOWERCASE/UPPERCASE) Windows API ignores those
letters.
  LCMapString(lcid, LCMAP_LOWERCASE, "I")- "i"
  LCMapString(lcid, LCMAP_UPPERCASE, "i")- "I"
  LCMapString(lcid, LCMAP_LOWERCASE, "\xdd") - "\xdd" (no change)
  LCMapString(lcid, LCMAP_UPPERCASE, "\xfd") - "\xfd" (no change)   

I was looking to see if i could find a global list of what these
exceptions to normal mapping may be. However what i found was

http://srfi.schemers.org/srfi-13/mail-archive/msg00046.html

 - Turkish has different case mappings.
   
   Case-mapping functions are sensitive to external environment settings
   in ways not defined by this SRFI. E.g., the current $LC locale in Unix.
 
   Note that Turkish is the only language in the Unicode set with this problem.

Unfortunately for turkish this is a big problem. because it means that
the windows directory gets uppercased to W(I with a dot)NDOWS and thus
things fail under wine. 

So there are two issues. The first is that our LCMapString is wrong (it
calls straight toupper) and needs to be corrected. This is a simple fix.
However I was unable to find a comprehensive list of where windows is
nonstandard.

second, we directly call toupper and tolower all over in wine code. We
would need to change all those calls to something else which understands
the exceptions windows uses. What function should that be? Should there
be a new WINE_ToUpper function that everything calls, or should
everywhere we call toupper we instead call LCMapStringA() or CharUpper()
?

Also if anyone knows other languages which have nonstandard behavior
under windows it would be good to find out how many things like this we
will have to work on.

-aric




Re: Nonstandard capitilization

2000-11-10 Thread Ove Kaaven


On Fri, 10 Nov 2000, Aric Stewart wrote:

 I was looking to see if i could find a global list of what these
 exceptions to normal mapping may be.

Global list? Case mapping is pretty much locale-dependent by definition.
Everyone knows about the German sharp S, too, I guess... uppercase of ß
is SS.

 So there are two issues. The first is that our LCMapString is wrong (it
 calls straight toupper) and needs to be corrected. This is a simple fix.
 However I was unable to find a comprehensive list of where windows is
 nonstandard.

Is it really? There's a documented LCMAP_LINGUISTIC_CASING flag - whenever
it's not specified, Windows defaults to filesystem-compatible casing.

 second, we directly call toupper and tolower all over in wine code. We
 would need to change all those calls to something else which understands
 the exceptions windows uses. What function should that be? Should there
 be a new WINE_ToUpper function that everything calls, or should
 everywhere we call toupper we instead call LCMapStringA() or CharUpper()
 ?

Of course we should use standard routines rather than defining more
Wine-internal routines.