| 33 | } |
| 34 | |
| 35 | static void swkbdConvertToUTF8(char* out, const u16* in, int max) |
| 36 | { |
| 37 | if (!in || !*in) |
| 38 | { |
| 39 | out[0] = 0; |
| 40 | return; |
| 41 | } |
| 42 | |
| 43 | ssize_t units = utf16_to_utf8((uint8_t*)out, in, max); |
| 44 | if (units < 0) |
| 45 | { |
| 46 | out[0] = 0; |
| 47 | return; |
| 48 | } |
| 49 | |
| 50 | out[units] = 0; |
| 51 | } |
| 52 | |
| 53 | static void swkbdConvertToUTF16(u16* out, const char* in, int max) |
| 54 | { |
no test coverage detected