| 43 | |
| 44 | |
| 45 | XMLString toXMLString(const std::string& str) |
| 46 | { |
| 47 | XMLString result; |
| 48 | result.reserve(str.size()); |
| 49 | |
| 50 | for (std::string::const_iterator it = str.begin(); it != str.end();) |
| 51 | { |
| 52 | wchar_t c; |
| 53 | int n = mbtowc(&c, &*it, MB_CUR_MAX); |
| 54 | result += c; |
| 55 | it += (n > 0 ? n : 1); |
| 56 | } |
| 57 | return result; |
| 58 | } |
| 59 | |
| 60 | |
| 61 | #endif // XML_UNICODE_WCHAR_T |
no test coverage detected