Help save net neutrality! Learn more.
Close

#23 utf8 to utf8 conversion consumes invalid utf8 without error

open
nobody
None
5
2012-10-02
2012-10-02
ygrek
No

Consider the following code which wrongly interprets cp1251 as utf8 and converts it from utf8 to utf8

module C = CamomileLibraryDefault.Camomile.CharEncoding;;
let s = "\210\229\245\239\238\228\228\229\240\230\234\224";;
C.recode_string C.utf8 C.utf8 s;;

and doesn't throw any exception but produces

"\211\165\246\176\175\164\229\166\176\231\171\160"

Or is it an intended behaviour?

Discussion


Log in to post a comment.