Files
python-datrie/datrie-bigendian.patch
Tomáš Chvátal 456242602c Accepting request 587589 from home:oertel:branches:devel:languages:python
- add datrie-bigendian.patch (bsc#1085526)
  to use utf_32_be instead of utf_32_le on bigendian machines

OBS-URL: https://build.opensuse.org/request/show/587589
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-datrie?expand=0&rev=6
2018-03-15 17:47:31 +00:00

16 lines
489 B
Diff

--- datrie-0.7.1/src/datrie.pyx 2018/03/15 17:07:17 1.1
+++ datrie-0.7.1/src/datrie.pyx 2018/03/15 17:09:19
@@ -1108,8 +1108,10 @@
if length == 0:
length = cdatrie.alpha_char_strlen(key)*sizeof(cdatrie.AlphaChar)
cdef char* c_str = <char*> key
- return c_str[:length].decode('utf_32_le')
-
+ if sys.byteorder == "big":
+ return c_str[:length].decode('utf_32_be')
+ else:
+ return c_str[:length].decode('utf_32_le')
def to_ranges(lst):
"""