mirror of
https://github.com/mehah/otclient
synced 2026-08-15 16:29:06 -04:00
Update string encoding implementation to use utf8cpp This change updates the string encoding implementation to use the utf8cpp library for improved robustness and consistency across platforms. It refactors the encoding functions in src/framework/stdext/string.cpp, adds comprehensive unit tests, updates build configurations to include utf8cpp, and documents the new encoding policy and behavior. String encoding improvements Refactored all string encoding functions in src/framework/stdext/string.cpp to use the utf8cpp library, providing strict UTF-8 validation, robust conversions between UTF-8, Latin-1, and UTF-16, and consistent error handling. Added a new documentation file docs/string-encoding-policy.md detailing the updated encoding policy, error handling, dependencies, and testing strategy. Testing enhancements Added a new unit test suite in tests/stdext/string_encoding_test.cpp covering UTF-8 validation, conversions, roundtrip consistency, control character handling, and platform-specific UTF-16 conversions. Updated the test build configuration to include the new test directory and sources. Build system updates Updated src/CMakeLists.txt to require and link the utf8cpp library for all platforms, ensuring proper integration. Added utf8cpp as a dependency in vcpkg.json for package management. |
||
|---|---|---|
| .. | ||
| convert_stdext_format.py | ||
| generate_spell_data.py | ||
| string-encoding-policy.md | ||