That's a subset of possible inputs, you're better off using a library that's a bit more complete. This may be useful: <a href="https://github.com/mochi/mochiweb/blob/master/src/mochiweb_charref.erl">https://github.com/mochi/mochiweb/blob/master/src/mochiweb_charref.erl</a><br>
<br><div class="gmail_quote">On Tue, Sep 25, 2012 at 11:48 AM, Zabrane Mickael <span dir="ltr"><<a href="mailto:zabrane3@gmail.com" target="_blank">zabrane3@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">answering my own question:<div><br><div><div>unescape(<<>>) -> </div><div> <<>>;</div><div>unescape([]) -></div><div> <<>>;</div><div>unescape(L) when is_list(L) -></div>
<div> unescape(list_to_binary(L));</div><div>unescape(B) when is_binary(B) -></div><div> unescape(B, <<>>).</div><div><br></div><div>unescape(<<>>, Acc) -> </div><div> Acc;</div><div>
unescape(<<" ", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, " ">>);</div><div>unescape(<<"&", T/binary>>, Acc) -></div>
<div> unescape(T, <<Acc/binary, "&">>);</div><div>unescape(<<""", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "\"">>);</div>
<div>unescape(<<"'", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "\'">>);</div><div>unescape(<<"'", T/binary>>, Acc) -></div>
<div> unescape(T, <<Acc/binary, "'">>);</div><div>unescape(<<"<", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "<">>);</div>
<div>unescape(<<">", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, ">">>);</div><div>unescape(<<"€", T/binary>>, Acc) -></div>
<div> unescape(T, <<Acc/binary, "€">>);</div><div>unescape(<<"ç", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "ç">>);</div>
<div>unescape(<<"à", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "à">>);</div><div>unescape(<<"â", T/binary>>, Acc) -></div>
<div> unescape(T, <<Acc/binary, "â">>);</div><div>unescape(<<"ä", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "ä">>);</div><div>
unescape(<<"æ", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "æ">>);</div><div>unescape(<<"è", T/binary>>, Acc) -></div>
<div> unescape(T, <<Acc/binary, "è">>);</div><div>unescape(<<"é", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "é">>);</div>
<div>unescape(<<"ê", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "ê">>);</div><div>unescape(<<"ë", T/binary>>, Acc) -></div>
<div> unescape(T, <<Acc/binary, "ë">>);</div><div>unescape(<<"î", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "î">>);</div>
<div>unescape(<<"ï", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "ï">>);</div><div>unescape(<<"ö", T/binary>>, Acc) -></div>
<div> unescape(T, <<Acc/binary, "ö">>);</div><div>unescape(<<"ù", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "ù">>);</div>
<div>unescape(<<"ú", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "ú">>);</div><div>unescape(<<"û", T/binary>>, Acc) -></div>
<div> unescape(T, <<Acc/binary, "û">>);</div><div>unescape(<<"ü", T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, "ü">>);</div><div>
<br></div><div>unescape(<<C, T/binary>>, Acc) -></div><div> unescape(T, <<Acc/binary, C>>).</div></div><div><br></div><div><br></div><div><div>Regards,</div><div>Zabrane</div></div><div><div class="h5">
<div><br></div><div><div>On Sep 25, 2012, at 8:02 PM, Zabrane Mickael wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word"><div>Hi huis,</div><div><br></div><div>I want to convert an HTML escaped text (<a href="http://www.w3schools.com/tags/ref_entities.asp" target="_blank">http://www.w3schools.com/tags/ref_entities.asp</a>) like this one:</div>
<div><br></div>bourg<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:12px;white-space:normal;font-family:verdana,helvetica,arial,sans-serif;word-spacing:0px">é </span>Cop<div>
<br></div><div>to:</div><div><br></div><div>bourgé Cop</div><div><br></div><div>Is there any Erlang library for this?</div><div><br><div>
<div>Regards,</div><div>Zabrane</div>
</div>
<br></div></div></blockquote></div><div><br>
</div>
<br></div></div></div></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br>