| 103 | } |
| 104 | |
| 105 | const char *UnicodeToString(const char *cc) |
| 106 | { |
| 107 | out.Resize((unsigned)strlen(cc) + 1); |
| 108 | int ndx = 0; |
| 109 | while (*cc != 0) |
| 110 | { |
| 111 | int size; |
| 112 | int c = utf8_decode((const uint8_t*)cc, &size); |
| 113 | if (c < 0 || c > 255) c = '?'; // This should never happen because all content was encoded with StringToUnicode which only produces code points 0-255. |
| 114 | out[ndx++] = c; |
| 115 | cc += size; |
| 116 | } |
| 117 | out[ndx] = 0; |
| 118 | return &out[0]; |
| 119 | } |
| 120 | |
| 121 | //========================================================================== |
| 122 | // |
no test coverage detected