| 280 | } |
| 281 | |
| 282 | int CopyTextElement(const char* text, int pos, int langID, char* out, size_t outSize) |
| 283 | { |
| 284 | if (!out || outSize == 0) |
| 285 | return pos; |
| 286 | out[0] = 0; |
| 287 | |
| 288 | if (!text) |
| 289 | return pos; |
| 290 | |
| 291 | int next = NextTextElementPos(text, pos, langID); |
| 292 | int span = std::max(0, next - pos); |
| 293 | size_t copyLen = std::min(static_cast<size_t>(span), outSize - 1); |
| 294 | if (copyLen > 0) |
| 295 | memcpy(out, text + pos, copyLen); |
| 296 | out[copyLen] = 0; |
| 297 | return next; |
| 298 | } |
| 299 | |
| 300 | int EncodeUtf8Codepoint(uint32_t codepoint, char* out, size_t outSize) |
| 301 | { |
no test coverage detected