[erlang-questions] Fail to parse utf-8 encoded XML

Anthony Ramine n.oxyde@REDACTED
Fri Mar 27 12:04:20 CET 2015


Le 27 mars 2015 à 10:52, Daniel Abrahamsson <daniel.abrahamsson@REDACTED> a écrit :

> Is this a bug in xmerl or am I missing something obvious?

You are missing an inconspicuous thing.

xmerl_scan:string/1 takes a list of code units. Try:

	xmerl_scan:string(binary_to_list(<<"<?xml version=\"1.0\" encoding=\"UTF-8\"?><root>ümlaut</root>"/utf8>>)).

Regards.




More information about the erlang-questions mailing list