9 Commits

Author SHA1 Message Date
2674bb0e32 string: add variants for char16_t/char32_t strings
char16_t is not exactly the wchar_t on Windows. char32_t is not exactly
the wchar_t on POSIX. Rather than selecting the appropriate variant,
polymorphism picked the template implementation of strncmp, strcpy and
strncpy. The one that does not convert UTF16 surrogate pairs against
their UTF32 representation.

Signed-off-by: Simon Rozman <simon@rozman.si>
2025-01-13 11:01:01 +01:00
a7543cf9ab string: add snprintf
Signed-off-by: Simon Rozman <simon@rozman.si>
2025-01-13 11:01:01 +01:00
8fd9fbf191 Bump Copyright year
Signed-off-by: Simon Rozman <simon@rozman.si>
2025-01-08 12:36:35 +01:00
5675f8b139 string: add recoding from UTF-16 to UTF-32
I know there are system functions for this (and libiconv), but this is
so trivial and quick in our implementation.
2024-09-27 14:11:11 +02:00
0560c7bce9 Add missing UTF-8 BOM
This is required on Windows with default charset set to Windows-1252 or
another non-UTF-8 charset.

Signed-off-by: Simon Rozman <simon@rozman.si>
2024-02-14 12:33:29 +01:00
9acd185d44 UnitTest: redesing to avoid #include ".cpp" in Xcode
Each unit test .cpp file is not a separate compilation unit in Xcode project
like it is in Visual Studio. Hopefully, Visual Studio test tool still likes
this arrangement.

Signed-off-by: Simon Rozman <simon@rozman.si>
2024-02-08 15:18:42 +01:00
b5e35922f1 string: revert emojis in unit test
Actually, using ill-created locale was the cause sprintf returned EILSEQ on %ls inserts containing emoji.

Signed-off-by: Simon Rozman <simon@rozman.si>
2024-02-08 14:04:15 +01:00
08a18d1519 macOS support
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-02-08 12:09:33 +01:00
c5feba2ed0 string: add unit test for sprintf
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-09 19:31:07 +01:00