perl-unicode

Re: Converting string to UTF-16LE

2004-03-03 01:30:07
Anyway, sounds to me like someone has mixed Level 3 support into levels
1 and 2. If that's the case, I think it's a fundamental mistake. Perl 5
should pick a level to default to, and stick with it.  Going to other
levels should require explicit lexically-scoped declaration to minimize
magical action at a distance.  In particular, decent level 3 support
requires knowing the language you're working under, and is expected
to run a lot slower in some cases.

There's also some performance loss between levels 1 and 2.  That may be
the case here, if the tables in question are deemed to be "language
independent" (probably in the sense of "best guess at language
dependent behavior in the absence of actually knowing the language".)

FWIW, for this particular "case" and for the Perl 5.10 and Perl 6 I think the best way to handle these Unicode case foldings (CaseFoldings.txt and SpecCase.txt) would most probably be to do the foldings in _Perl_ compile-time: since there are, after all, only a few dozen of these special cases, generate the C folding code for /i
and the folding functions straight from the Unicode data tables.

--
Jarkko Hietaniemi <jhi(_at_)iki(_dot_)fi> http://www.iki.fi/jhi/ "There is this special
biologist word we use for 'stable'.  It is 'dead'." -- Jack Cohen