Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid multibyte sequence error on make l10n #958

Closed
arkid15r opened this issue Feb 17, 2023 · 4 comments
Closed

Invalid multibyte sequence error on make l10n #958

arkid15r opened this issue Feb 17, 2023 · 4 comments
Assignees

Comments

@arkid15r
Copy link
Collaborator

A bit minor note: I did try switching to having Thai text as default based on this PR, and the issue still persists when using make l10n as you can see below:

holidays/locale/pot/TH.pot:53: warning: The following msgid contains non-ASCII characters.
                                        This will cause problems to translators who use a character encoding
                                        different from yours. Consider using a pure ASCII msgid instead.
                                        พระราชพิธีฉลองสิริราชสมบัติครบ 60 ปี .. 2549
holidays/locale/pot/TH.pot:53: invalid multibyte sequence
holidays/locale/pot/TH.pot:53: invalid multibyte sequence
holidays/locale/pot/TH.pot:53: invalid multibyte sequence
holidays/locale/pot/TH.pot:53: invalid multibyte sequence
holidays/locale/pot/TH.pot:53: invalid multibyte sequence
holidays/locale/pot/TH.pot:53: invalid multibyte sequence

With this in mind, I'm considering continuing my approach on #946 instead, but will switch around the test cases to generate our desired result of having th as default and en_US as supported.

Originally posted by @PPsyrius in https://github.com/dr-prodigy/python-holidays/issues/955#issuecomment-1434250465

@arkid15r arkid15r changed the title Invalid multibyte sequence on make l10n Invalid multibyte sequence error on make l10n Feb 17, 2023
@arkid15r
Copy link
Collaborator Author

Hey @PPsyrius,
could you share your code - I'll try to reproduce the error and fix it.

@arkid15r arkid15r self-assigned this Feb 17, 2023
@PPsyrius
Copy link
Collaborator

@PPsyrius
Copy link
Collaborator

@arkid15r Found solution to this now, turns out on top of adding blank files, headers are also needed so that the reader would accept UTF-8 charset:

Here's one of the examples that finally get the script working for me:

TH.po
# Thailand holidays English translation.
# Authors: PPsyrius <ppsyrius@ppsyrius.dev>, (c) 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.20\n"
"POT-Creation-Date: 2023-02-19 14:03+0700\n"
"PO-Revision-Date: \n"
"Last-Translator: PPsyrius <ppsyrius@ppsyrius.dev>\n"
"Language-Team: Python Holidays Translation Team\n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

This issue can be closed down, IMO.

@arkid15r
Copy link
Collaborator Author

Hey @PPsyrius,
it's great you figured that out without my help!

Just FYI the misformatted .po file hadn't been included into https://github.com/PPsyrius/python-holidays/tree/955_thailand_i18n_support when I looked into it.

Anyway, it seems the error had to do with this specific header "Content-Type: text/plain; charset=UTF-8\n" absence.

Closing this out.

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

No branches or pull requests

2 participants