GNOME Bugzilla – Bug 780075
Added ustring::make_valid() which fixes non-UTF8 strings.
Last modified: 2017-03-15 09:00:13 UTC
Created attachment 347970 [details] [review] patch introducing this method make_valid replaces all non-UTF8 characters with replacement character (U+FFFD). Now you can do a lot more with an ustring after ustring::validate() tells you it's not a proper UTF-8 string, like iterating over it or printing it out. I have attached a patch for current master version which introduces this method.
Thanks. I have pushed that to glibmm master. I made some changes: * In the commit message, I mentioned that this wrap g_utf8_make_valid(). I was about to ask you to put this work in glib until I saw that it uses the glib function. * I corrected the formatting. We used two spaces instead of tabs in the rest of these files. * I commented out the unused repl_character variable in the tests. Maybe you meant to use this. When we pass --enable-warnings=fatal to autogen.sh, we see warnings such as this. Thanks again.