[erlang-questions] io:format error with UTF-8 encoding binary

Adam Lindberg adam@REDACTED
Wed May 16 16:06:56 CEST 2007


Hi Caoyuan!

You could try to change the language and see if that's it. Try going
to the Control Panel and start Regional and Language settings and
change it, see if that helps. You could also try to temporarily change
keyboard layout (seems to me that some stuff in Windows is connected
to that too).

Cheers!
Adam

On 5/16/07, Caoyuan <dcaoyuan@REDACTED> wrote:
> I'm just wondering if it depends on OS and OS's default Language
> setting, my language setting is zh_CN. I tried again and again on my
> machine, it hangs every time :-)
>
> On 5/16/07, Vlad Dumitrescu <vladdu55@REDACTED> wrote:
> > Hi,
> >
> > It works for me just fine on Windows.
> >
> > regards,
> > Vlad
> >
> > On 5/16/07, Caoyuan <dcaoyuan@REDACTED> wrote:
> > > Hi,
> > >
> > > Did somebody else encounter error when io:format(~p~n, [Bin]) where
> > > Bin is a binary with UTF-8 encoding string?
> > >
> > > I encountered this error several times, to reproduce it, please try
> > > attached text file:
> > > > erl
> > > 1> {ok, Bin} = file:read_file("6.txt").
> > > 2> io:format("Content: ~p~n", [Bin]).
> > >
> > > Then erl shell will hang, without any error message printed out. And
> > > also, the Bin could not be inserted into MYSQL blob field too.
> > >
> > > The lasted three bytes of 6.txt is <<226,128,156>>. If I remove these
> > > 3 bytes, everything works fine.
> > >
> > > My environment is Windows XP. the OTP is otp_win32_R11B-4
> > >
> > > Thanks.
> > >
> > > _______________________________________________
> > > erlang-questions mailing list
> > > erlang-questions@REDACTED
> > > http://www.erlang.org/mailman/listinfo/erlang-questions
> > >
> > >
> > >
> >
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
--
Adam Lindberg
Software Developer

Erlang Training and Consulting Ltd
401 Fruit and Wool Exchange,
Brushfield Street, London,
E1 6EL, United Kingdom
Company Registration 3893360 VAT Number GB 752 1091 57
Tel +44 207 456 1020
Fax +44 870 1390 779
Mobile +44 7960 726 016
Email adam@REDACTED



More information about the erlang-questions mailing list