<br><span class="gmail_quote">2007/4/18, Tim Becker <<a href="mailto:tim.becker@gmx.net">tim.becker@gmx.net</a>>:</span><br>><br>> Hmmm,<br>> thanks for the replies, I was worried more about how to implement the
<br>> conversion functions per se and completely overlooked the aspect of<br>> tail recursion.<br><br><br>Well, that part was fine. (:<br>You could also write a multibyte-capable version<br>like so:<br><br>map_1(F, Bin) ->
<br> {C, Rest} = F(Bin),<br> [C | map_1(F, Rest)];<br>map_1(F, <<>>) -> [].<br><br>where e.g. F could call:<br><br>cp037_to_iso8859_1 (<<129:1, Rest/binary>>) -> {97,Rest}; % a<br>...<br><br>
Then, your conversion fun could select as many bytes<br>as it needs to.<br><br>BR,<br>Ulf W <br><br>