in reply to User-Defined Case Mappings

Now that Tanktalus has answered your questions, I'd be curious to understand what you mean when you say:

I want to use simple Unicode case mapping and not the default full case mapping.

When I use Unicode strings in perl, I consider "simple Unicode case mapping" to be the same thing as "default full case mapping". But you seem to mean something else by it, so I'm confused.

I'm also curious whether you really intended to use "0044" as the third element being returned by your "ToUpper" sub. Did you really want uc("abcdef") to return "DEFdef"?

Replies are listed 'Best First'.
Re^2: User-Defined Case Mappings
by timgreenwood (Initiate) on Feb 24, 2009 at 17:05 UTC
    I'm also curious whether you really intended to use "0044" as the third element being returned by your "ToUpper" sub. Did you really want uc("abcdef") to return "DEFdef"?

    My code snippet was just to understand how to make the user mappings work. The snippet itself is not of practical use. The choice of "044" as the third element was pretty arbitrary and just to make the difference from the default mapping stand out.

    When I use Unicode strings in perl, I consider "simple Unicode case mapping" to be the same thing as "default full case mapping". But you seem to mean something else by it, so I'm confused.

    Unicode case mapping is described in Unicode Standard Annex #21. Briefly - a full mapping may expand one character to multiple characters. For example, the German character U+00DF "ß" small letter sharp s expands when uppercased to the sequence of two characters "SS". Casing may also be context dependent. Simple case mapping is defined in the UnicodeData.txt file from the Unicode Charater Database. It gives a 1-1 only case mapping that is not context dependent.