Is there a use for u"æøå" notation in perl?
Monday, February 1, 2010 9:50:54 AM
Encode, decode_utf8 for reading and encode_utf8 for outputting. But that's strictly for handling I/O.
When using strings constants containing utf8 characters you would need to either set the utf8 flag (
utf8::_utf8_on) on your string, use utf8::upgrade or use utf8;.
The latter a bit scary and possibly inconsistency as in addition to letting you use utf8 characters as variable names etc, it also treats all string constants as utf8 strings. However it needs to be included everywhere to be sure, and that might be cumbersome when using many modules, possibly external ones that don't etc. etc.
So I was wondering if there actually could be any use of having a similar notation to python to allow you to explicit set string constants as utf8. An example would be:
perl -wle 'sub u { utf8::upgrade(shift); }; print encode_utf(u"æøå");'
What do you think? 













Unregistered user # Monday, February 1, 2010 11:14:42 AM
Nicolas Mendozanicomen # Monday, February 1, 2010 11:27:08 AM
Also I have to wrongly flagged content, and enforcing it to be utf8 some places, so that it passes correctly thru regexps and substr and lc() calls etc. What to do then?
Unregistered user # Monday, February 1, 2010 1:59:43 PM
Nicolas Mendozanicomen # Friday, February 12, 2010 6:01:35 PM
Nicolas Mendozanicomen # Friday, February 12, 2010 6:55:09 PM