godot
godot copied to clipboard
Add methods to decode/encode multibyte encodings.
A more advanced version of https://github.com/godotengine/godot/pull/96950
Adds String.to_multibyte_char_buffer(encoding) and PackedByteArray.get_string_from_multibyte_char(encoding) to handle various non-Unicode encodings, encoding is a name string or empty value for system default encoding.
- On Windows, uses WinAPI functions and uses ".NET name" values from https://learn.microsoft.com/en-us/windows/win32/Intl/code-page-identifiers
- On macOS/Linux loads and uses system provided
libiconvlibrary, encoding list depends on specific iconv implementation.
On macOS/Linux loads and uses system provided libiconv library
~Seems like most Linux distros do not include iconv, glibc should have some sort of built-in implementation, but seems like it doesn't work at all.~ Should work with GLIBC implementation as well.
Thanks!
This broke Wasm builds with Aborted(Assertion failed: Tried to dlsym() from an unopened handle: -1), at least my game using godot-rust gdextension
I recommend opening a new issue with more details. How does the issue lead to this PR? At a glance, it looks like new methods were added and existing code was not touched.
I recommend opening a new issue with more details. How does the issue lead to this PR? At a glance, it looks like new methods were added and existing code was not touched.
git bisect