firebreath/FireBreath — pull request #109 by diorcety (2013-06-21 11:39:36+00:00)
Title: Invalid UTF chars in strings

In order to avoid exception when converting utf8 to utf16/32 (and otherwise) we replace invalid characters by a replacement character.

There is many issues:

-The utf8::replace_invalid in wstring_to_utf8 is not correct. the library doesn't provide a way to replace invalid character in utf-16. Myabe adding one can be usefull.

-replace_invalid can throw an exception NOT_ENOUGH_ROOM. It seems that happen when we reach the end of the string before a complete utf8 char. I don't know why throw an exception. Maybe replace the incomplet utf char by the replacement character is enough.

-The 49fb1f1 commit can be replace by updating the lib(the change is already made). If we don't declare "append" before, clang is not happy.