Skip to content

BUGFIX: Decode string based on byteorder of system#85

Merged
tacaswell merged 1 commit intopytries:masterfrom
Aniket-Pradhan:master
Aug 28, 2025
Merged

BUGFIX: Decode string based on byteorder of system#85
tacaswell merged 1 commit intopytries:masterfrom
Aniket-Pradhan:master

Conversation

@Aniket-Pradhan
Copy link
Contributor

Fixes #38

Big-endian machines are unable to decode the UTF-32 encoded strings. The default decoding is for little-endian machines. Therefore, added a simple if condition to identify the type of machine before decoding the string.

@michelmno
Copy link

patch already validated in openSUSE since a while: https://build.opensuse.org/package/view_file/openSUSE:Factory:PowerPC/python-datrie/datrie-bigendian.patch?expand=1

@Aniket-Pradhan
Copy link
Contributor Author

Yep, we'll probably use a similar patch for Fedora until the PR is accepted.

@mr-c
Copy link

mr-c commented Nov 4, 2020

I just added this to the Debian package, thanks all!

sarnold added a commit to freepn/datrie that referenced this pull request Nov 16, 2020
* respin debian patch
* add endian fix from upstream PR

Origin1: https://salsa.debian.org/python-team/packages/python-datrie/-/tree/master/debian/patches
Origin2: upstream, pytries#85
Signed-off-by: Stephen L Arnold <nerdboy@gentoo.org>
@tacaswell tacaswell merged commit 0a9a30e into pytries:master Aug 28, 2025
@tacaswell
Copy link
Contributor

I merged this after I tagged 0.8.3, hopefully #104 will get some attention and then we can do a 0.8.4 soonish.

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.

UnicodeDecodeError: 'utf32' codec can't decode bytes in position 0-3: code point not in range(0x110000)

4 participants