godot icon indicating copy to clipboard operation
godot copied to clipboard

Add methods to decode/encode multibyte encodings.

Open bruvzg opened this issue 1 year ago • 1 comments

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 libiconv library, encoding list depends on specific iconv implementation.

bruvzg avatar Sep 14 '24 15:09 bruvzg

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.

bruvzg avatar Oct 07 '24 06:10 bruvzg

Thanks!

akien-mga avatar Mar 28 '25 16:03 akien-mga

This broke Wasm builds with Aborted(Assertion failed: Tried to dlsym() from an unopened handle: -1), at least my game using godot-rust gdextension

marcosc90 avatar Apr 25 '25 18:04 marcosc90

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.

Mickeon avatar Apr 25 '25 18:04 Mickeon

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

marcosc90 avatar Apr 25 '25 18:04 marcosc90