Skip to content

feat(icu4c): Add ICU4C support to UTF8 string operations - #3187

Draft
CryoTheRenegade wants to merge 3 commits into
TheSuperHackers:mainfrom
CryoTheRenegade:feat/icu4c-utf8
Draft

feat(icu4c): Add ICU4C support to UTF8 string operations#3187
CryoTheRenegade wants to merge 3 commits into
TheSuperHackers:mainfrom
CryoTheRenegade:feat/icu4c-utf8

Conversation

@CryoTheRenegade

Copy link
Copy Markdown

Replaces the hand-rolled WWLib UTF-8 converter with ICU4C, and links ICU into the engine so later code can use the rest of the suite.

AsciiString::translate / UnicodeString::translate now convert through ICU instead of 7-bit ASCII. Invalid UTF-8 still falls back to the original one-byte-to-one-wide-unit behavior so legacy CP1252 data is preserved. LAN player names are truncated on a UTF-8 code-point boundary instead of chopping mid-sequence.

ICU is selected in this order:

  1. find_package(ICU) from vcpkg / system (C and C++ APIs)
  2. Windows SDK icu.lib + /DELAYLOAD:icu.dll on modern MSVC
  3. VC6 LoadLibrary of OS icu.dll, with Win32 CP_UTF8 if that DLL is missing

WWLib/IcuSupport.h is the engine include for linked ICU. vcpkg now depends on icu on all platforms.

Use vcpkg or the Windows SDK C API on modern builds, keep VC6 on runtime LoadLibrary, and only probe system icu.dll for the delay-loaded SDK path.
Preserve bobtista's original change comments and append the ICU conversion notes instead of replacing them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant