[erlang-questions] unicode + version < 17.0

Benoit Chesneau bchesneau@REDACTED
Thu Apr 17 17:27:59 CEST 2014


On Thu, Apr 17, 2014 at 5:19 PM, José Valim <jose.valim@REDACTED
> wrote:

> When you say input, do you mean the standard input? If so, you can set the
> IO device to be unicode explicitly:
>
>     ok = io:setopts(standard_io, [binary,{encoding,utf8}])
>     ok = io:setopts(standard_error, [{unicode,true}])
>
> This works if you are only reading and writing to standard io and standard
> error.
>
> If working with files, you must pass the unicode option when opening the
> file and if you want to have unicode filenames, you need to pass them as
> binaries (or be sure to start the VM with one of the +fnu flags).
>
> file:get_cwd, init:get_arguments and os:cmd may also have different
> behaviour depending on the OS before R17. For those cases, you need to do a
> proper translation using file:native_name_encoding() or alternatively just
> set the +fnu flag on boot as well.
>
>
Sorry I mean input as argument to a function, so in the source code file I
have

    Input = "http://www.詹姆斯.com/atomtests/iri/<http://www.xn--8ws00zhy3a.com/atomtests/iri/>
詹.html",
    myfunc(Input)

- benoit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140417/bb35eb0c/attachment.htm>


More information about the erlang-questions mailing list