fixes UTF8 inplace – replaces invalid octets with replace character
| 129 | |
| 130 | // fixes UTF8 inplace – replaces invalid octets with replace character |
| 131 | void Helper::fixUtf8(std::string& str) { |
| 132 | std::string temp; |
| 133 | try { |
| 134 | utf8::replace_invalid(str.begin(), str.end(), back_inserter(temp)); |
| 135 | } catch( utf8::not_enough_room& e ) { |
| 136 | #ifdef DEBUG |
| 137 | std::cerr << "utf8::not_enough_room: " << str << std::endl; |
| 138 | #endif |
| 139 | } |
| 140 | str = temp; |
| 141 | } |
| 142 | |
| 143 | |
| 144 | // converts Latin-1 to UTF-8 |
nothing calls this directly
no test coverage detected