Feature request #2315

QGIS exceptions does not support unicode

Added by marisn - almost 11 years ago. Updated almost 11 years ago.

Assignee:Jürgen Fischer
Category:Translations and international
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:12375


Current exception handling in QGIS can not display correctly non-ascii error messages. Still there is a code, that migh emit exception with unicode text as it's content. Currently such text is displayed as ascii string (non-ascii chars are grabbled). Such issue could be solved, if exception text would be stored as a QString, still as I have no skills in C++ and Qt, I can't provide patches :(

Example: https://trac.osgeo.org/qgis/browser/trunk/qgis/src/core/qgscoordinatetransform.cpp?rev=12550#L473

qgscoordinatetransform_exception_message.patch Magnifier - qgscoordinatetransform exception text is a pain for translators. Please, don't make such strings. (1.81 KB) marisn -, 2009-12-23 02:51 AM

qgis_forward_encoding1.png - UTF-8 string displayed as an ASCII string (205 KB) marisn -, 2009-12-24 04:11 AM

qgscoordtransform.patch Magnifier - Merged my and Jef's patch in translator-friendly way. It doesn't fix this issue, just part of it. (4.14 KB) marisn -, 2009-12-24 04:14 AM

pjerr.diff Magnifier (3.71 KB) Jürgen Fischer, 2009-12-24 07:23 AM

Associated revisions

Revision d2d9cf9a
Added by Jürgen Fischer almost 11 years ago

fix #2315

git-svn-id: http://svn.osgeo.org/qgis/trunk/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision a13c99d1
Added by Jürgen Fischer almost 11 years ago

fix #2315

git-svn-id: http://svn.osgeo.org/qgis/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c


#1 Updated by Jürgen Fischer almost 11 years ago

The exception can handle non-ascii messages.

I've already had a pending patch - which also contains string changes, we can't currently commit. Although I wasn't able to get a garbled error message as my proj doesn't emit localized messages. I just see the latvian error message with an English error text from proj.

#2 Updated by marisn - almost 11 years ago

Changing bug description back to original, as proj.4 currently does not support localized error messages. This is (almost) pure QGIS issue.

Compiled current QGIS trunk (b2e7a7c1 (SVN r12613)) without any CMAKE_BUILD_TYPE setting with Qt 4.6.0. QGIS displays pop-up with text and after clicking OK, it's impossible to close QGIS window (only with xkill):

Neveiksmīgs forward transformēšana no
(10075.3, 112109)
ar kļūdu: latitude or longitude exceeded limits

String should read (still it's grammatically incorrect due to how this string is represented to translators and hardcoded "forward" word):
Neveiksmīgs forward transformēšana ...

IMHO problem lies here: http://trac.osgeo.org/qgis/browser/trunk/qgis/src/core/qgsexception.h#L54
Conversion between QString and std::string is done via fromAscii() (if I understood QString manual correctly).

#3 Updated by Jürgen Fischer almost 11 years ago

ed0d9dad (SVN r12616) should catch the exceptions in the first place (the V2 renderers would hang otherwise),
8cc3c65e (SVN r12617) should fix the encoding problem, if they still become visible somewhere,
but the translation string update is still pending.

#4 Updated by Jürgen Fischer almost 11 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

applied in a13c99d1 (SVN r12641).

Also available in: Atom PDF