[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: [perl #58182] Unicode problem



 From the little feedback I got on this issue and my own thoughts, I've 
developed a straw proposal for comment.

I propose a global flag that says whether or not the mode previously 
outlined (to give full Unicode semantics to characters in the full 
latin1 range even when not stored as utf8) is in effect or not.  This 
flag will be turned on or off through a lexically scoped pragma.  The 
default for 5.12 will be on.  If this gets put into 5.10.x, the mode 
will be off.

This mode will be subservient to "use bytes".  That is, whenever the 
bytes mode is in effect, this new mode will not be.  This is in part to 
preserve compatibility with existing programs that explicitly use the 
bytes pragma.

If a string is defined under one mode but looked at under the other, the 
mode in effect at the time of interpretation will be the one used.

A pattern, however, is compiled, and that compilation will remain in 
effect even if the mode changes.

One could argue about whether the last two paragraphs are the best or 
not, but doing them otherwise is a lot harder, and it is my  that it 
would be the very rare program that would want to toggle between these 
modes, so that in practice it doesn't matter.

Comments?


Follow-Ups from:
"Rafael Garcia-Suarez" <rgarciasuarez@gmail.com>
References to:
karl williamson <public@khwilliamson.com>
Glenn Linderman <perl@NevCal.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]