These two functions are enough to get several games running (ScarQuest, Marvel Snap).
In the long run I'm not sure how we want to proceed with this DLL. ICU has [a complicated license](https://github.com/unicode-org/icu/blob/main/LICENSE) and is largely C++, so integrating it into wine under `libs/` may be tricky. They do distribute official Windows binaries, and Proton is [repackaging those](https://github.com/ValveSoftware/Proton/tree/proton_10.0/icu) and [adding an icu.dll that forwards to them](https://github.com/ValveSoftware/wine/tree/3e3b24184a29e8e35cd618100fefabccf...).
From: Tim Clem tclem@codeweavers.com
--- configure | 2 ++ configure.ac | 1 + dlls/icu/Makefile.in | 5 +++++ dlls/icu/icu.c | 47 ++++++++++++++++++++++++++++++++++++++++++++ dlls/icu/icu.spec | 2 ++ 5 files changed, 57 insertions(+) create mode 100644 dlls/icu/Makefile.in create mode 100644 dlls/icu/icu.c create mode 100644 dlls/icu/icu.spec
diff --git a/configure b/configure index 23fc01d0aad..1c3a714ff90 100755 --- a/configure +++ b/configure @@ -1182,6 +1182,7 @@ enable_ia2comproxy enable_iccvid enable_icmp enable_icmui +enable_icu enable_ieframe enable_ieproxy enable_iertutil @@ -22389,6 +22390,7 @@ wine_fn_config_makefile dlls/iccvid enable_iccvid wine_fn_config_makefile dlls/icmp enable_icmp wine_fn_config_makefile dlls/icmui enable_icmui wine_fn_config_makefile dlls/icmui/tests enable_tests +wine_fn_config_makefile dlls/icu enable_icu wine_fn_config_makefile dlls/ieframe enable_ieframe wine_fn_config_makefile dlls/ieframe/tests enable_tests wine_fn_config_makefile dlls/ieproxy enable_ieproxy diff --git a/configure.ac b/configure.ac index 6d093b52526..e38262d4c3d 100644 --- a/configure.ac +++ b/configure.ac @@ -2757,6 +2757,7 @@ WINE_CONFIG_MAKEFILE(dlls/iccvid) WINE_CONFIG_MAKEFILE(dlls/icmp) WINE_CONFIG_MAKEFILE(dlls/icmui) WINE_CONFIG_MAKEFILE(dlls/icmui/tests) +WINE_CONFIG_MAKEFILE(dlls/icu) WINE_CONFIG_MAKEFILE(dlls/ieframe) WINE_CONFIG_MAKEFILE(dlls/ieframe/tests) WINE_CONFIG_MAKEFILE(dlls/ieproxy) diff --git a/dlls/icu/Makefile.in b/dlls/icu/Makefile.in new file mode 100644 index 00000000000..441c30c5a93 --- /dev/null +++ b/dlls/icu/Makefile.in @@ -0,0 +1,5 @@ +MODULE = icu.dll + +EXTRADLLFLAGS = -Wb,--prefer-native + +SOURCES = icu.c diff --git a/dlls/icu/icu.c b/dlls/icu/icu.c new file mode 100644 index 00000000000..991b7392850 --- /dev/null +++ b/dlls/icu/icu.c @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2025 Tim Clem for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> +#include <stdint.h> + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(icu); + +typedef WCHAR UChar; +typedef int32_t UErrorCode; /* Actually an enum */ + +int32_t CDECL ucal_getTimeZoneIDForWindowsID( const UChar *winid, int32_t len, const char *region, + UChar *id, int32_t idCapacity, UErrorCode *status ) +{ + FIXME("%s %s %p %d %p - stub\n", + len == -1 ? debugstr_w(winid) : debugstr_wn(winid, len), + debugstr_a(region), id, idCapacity, status); + + /* This is ICU's documented behavior when the Windows ID is unmappable or + unknown. It does not touch status or id in this case. */ + return 0; +} + +const char * CDECL u_errorName( UErrorCode code ) +{ + FIXME("%d - stub\n", code); + return "U_UNSUPPORTED_ERROR"; +} diff --git a/dlls/icu/icu.spec b/dlls/icu/icu.spec new file mode 100644 index 00000000000..00a4aa707e3 --- /dev/null +++ b/dlls/icu/icu.spec @@ -0,0 +1,2 @@ +@ cdecl ucal_getTimeZoneIDForWindowsID(ptr long ptr ptr long ptr) +@ cdecl u_errorName(long)
+EXTRADLLFLAGS = -Wb,--prefer-native
Yeah, --prefer-native is important here, many apps (and notably CEF pack distributed with apps) ship working icu.dll and that is what gets loaded on Windows too.
FWIW Microsoft's system icu.dll is a fork of open source one with some changes, it is available here: https://github.com/microsoft/icu . And I think forking and shipping the library in 3rd party software is not prohibited by Unicode license. Probably the main problem is that it is C++. But maybe it is possible in theory to ship from a separate fork, technically similar to Wine-Mono or Wine-Gecko? I don't actually see why Wine couldn't download directly from Unicode repo (using an installer similar to Wine-Mono) in principle, although original Unicode Windows dll releases from https://github.com/unicode-org/icu/ differ, most notably, in versioned naming of the dll and exports.
Sorry, meant "original Unicode Windows dll releases from https://github.com/unicode-org/icu/", edited above.
Most of the Microsoft patches look like changes to tests or build scripts, but making [`u_cleanup` a no-op](https://github.com/microsoft/icu/blob/master/icu-patches/patches/006-MSFT-Pa...) is significant. Unfortunately they don't publish binaries from that repo, they do [publish binaries through NuGet](https://www.nuget.org/packages/Microsoft.ICU.ICU4C.Runtime.win-x64) but I think there are differences between those and the Windows OS builds.
The major end difference between Unicode and MS one are export names, using icuXX.dll from Unicode in place of icu.dll just won't work, the public exports have version suffix. While the library is C++, public exports (available on Windows) are C, so in theory it might be possible to build the dll with mingw (although probably not very easily).
icu4c is build by [mxe](https://mxe.cc/#packages), so building icu.dll should not be too difficult. The recipe is here https://github.com/mxe/mxe/blob/master/src/icu4c.mk.
Ok, I tried to take my time to read the icu license file, it's mainly a lot of BSD-like or MIT-like licenses worded slightly differently.
The only files under GPLv2 or GPLv3 are some build files. (Ctrl+F: "The condition for the exception is fulfilled" in the `LICENSE` file)
So I do not think there would be any licensing issue for adding the icu library to Wine.
The ICU `LICENSE` file link: https://github.com/unicode-org/icu/blob/main/LICENSE