You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to know if libgettextpo is available? Run ctypes.util.find_library("gettextpo") in setup.py. If returns None is not available.
To read PO files without defined charset "MIME-Version: 1.0\\n"\n"Content-Type: text/plain; charset=utf-8\\n" must be added to the headers or the next error will be raised:
Error
>>> gettextpo.PoFile('example.po')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
gettextpo.error: Charset missing in header.
Message conversion to user's charset will not work.
The text was updated successfully, but these errors were encountered:
I've done some tests in a local branch. Seems that the current implementation of the library is not enough complete. Create the same interface of polib using the library at C level would be the greatest improvement.
After the developing of md-ulb-pwrap I'm thinking that the best option to optimize the usage of polib is rewriting the library as a CPython extension with Rust.
mondeja
changed the title
Use pygettextpo instead of polib if libgettextpo is available
Use an optimized low level PO parser library
Feb 19, 2023
Looks like possible and should improve performance. See https://launchpad.net/pygettextpo
libgettextpo
is available? Runctypes.util.find_library("gettextpo")
insetup.py
. If returnsNone
is not available.To read PO files without defined charset
"MIME-Version: 1.0\\n"\n"Content-Type: text/plain; charset=utf-8\\n"
must be added to the headers or the next error will be raised:Error
>>> gettextpo.PoFile('example.po') Traceback (most recent call last): File "<stdin>", line 1, in <module> gettextpo.error: Charset missing in header. Message conversion to user's charset will not work.
The text was updated successfully, but these errors were encountered: