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

Some language names do not display correctly #8

Closed
scx opened this issue Jan 13, 2019 · 1 comment
Closed

Some language names do not display correctly #8

scx opened this issue Jan 13, 2019 · 1 comment

Comments

@scx
Copy link
Contributor

scx commented Jan 13, 2019

Description of problem:

Some language names do not display correctly.

Version-Release number of selected component:

  • qtspell-0.8.5
  • gImageReader-3.3.0 (Qt version)

Steps to Reproduce (Fedora 29):

  1. Install gimagereader-qt5.
  2. Install hunspell-*, or at least hunspell-oc.
  3. Open gimagereader-qt5.
  4. Add an image from file or take a screenshot.
  5. Select: OCR mode: Plain text.
  6. Click: Recognize all.
  7. Open the context menu in the text box in the output pane.
  8. Select Languages.

Actual results:

Occitan (post 1500); Proven�al

Expected results:

Occitan (post 1500); Provençal

Additional info:

Conversion to Latin1 causes loss of information about some characters.

name = QString::fromUtf8(dgettext(ISO_639_DOMAIN, name.toLatin1().data()));

name = QString::fromUtf8(dgettext(ISO_3166_DOMAIN, name.toLatin1().data()));;

Explanation:

You should replace these lines:

name = QString::fromUtf8(dgettext(ISO_639_DOMAIN, name.toLatin1().data()));
name = QString::fromUtf8(dgettext(ISO_3166_DOMAIN, name.toLatin1().data()));;

with these:

name = QString::fromUtf8(dgettext(ISO_639_DOMAIN, name.toUtf8().constData()));
name = QString::fromUtf8(dgettext(ISO_3166_DOMAIN, name.toUtf8().constData()));

or these:

name = QString::fromLocal8Bit(dgettext(ISO_639_DOMAIN, name.toLocal8Bit().constData()));
name = QString::fromLocal8Bit(dgettext(ISO_3166_DOMAIN, name.toLocal8Bit().constData()));

Temporary solution:

https://github.com/scx/flathub/blob/030990011b8622d86a478a3314c33592b2539aae/qtspell-0.8.5-utf8.patch
Pull request on the way.

This bug report is related to submitting my flatpak package to the Flathub repository.
manisandro/gImageReader#396
flathub/flathub#810

@scx
Copy link
Contributor Author

scx commented Jan 13, 2019

Pull request (closes this bug):
#9

manisandro added a commit that referenced this issue Jan 13, 2019
Use UTF-8 encoding instead of Latin-1. Closes #8
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

1 participant