[erlang-questions] kick start a newb!
Samuel Tesla
samuel@REDACTED
Thu Feb 7 23:42:30 CET 2008
Dustin:
Looking at the URL you included in your post, I'd agree it probably is UTF-8
related. As Lev was alluding to in his response, in Erlang strings are just
a list of integers. At the top level, when you have a list of integers, if
all of them are printable ASCII characters, it will display them as a
string, hence [65,65,65] will be printed "AAA", whereas [1,2,3] will print
[1,2,3].
Not all of the bytes in a UTF-8 encoded string are necessarily printable
ASCII. So, it shows up as a list of integers. What you may want to do is
look at xmerl (http://erlang.org/doc/apps/xmerl/index.html) to parse the
XML. It will handle the character set conversions. If, for some reason, you
want to do it on your own, I believe xmerl_ucs:from_utf8/1 may serve you
well. But, that module is undocumented and thus not guaranteed to remain the
same from release to release.
I hope that helps!
-- Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080207/80a6c672/attachment.htm>
More information about the erlang-questions
mailing list