in reply to Re: why no default unicode?
in thread why no default unicode?

Well, I'd prefer it to use UTF-8 for the Term if there term is setup to use UTF-8 (i.e. as expressed by local).

For files, it should probably default to binary unless told otherwise.

Since all my terms are UTF-8, is how about a way to tell it to use UTF-8 on 'tty' devices, but default to binary on files? Too much intelligence built into the startup code, probably eh?...

Either that, OR..."auto-switch": if detect widechar on output, then convert to UTF-8 bytes... That would be the most helpful -- since it knows I'm trying to output a wide-char, so it should (IMO) *try* to do the best it can and assume a UTF-8 output device...

What would be the 'downsides' of that approach? (I.e. instead of the current approach of putting out a warning)...

Replies are listed 'Best First'.
Re^3: why no default unicode?
by BrowserUk (Patriarch) on Mar 20, 2011 at 00:10 UTC

    Read the linked documentation. If you don't want open to default to utf-8, then set PERL5OPT='-CS'

    As for auto-detecting. There is no way for perl (or any other language) to determine the difference between an input file containing utf-8, and an input file containing arbitrary binary.

    Indeed, there is no way to distinguish between utf-8 and utf-2 or utf-32 or arbitrary binary. In this respect the entire unicode standard is terminally broken.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^3: why no default unicode?
by moritz (Cardinal) on Mar 20, 2011 at 07:27 UTC