Bug 277731 - Setting a field's data source to a calculated value, results international characters not displaying correctly
Summary: Setting a field's data source to a calculated value, results international ch...
Status: CLOSED FIXED
Alias: None
Product: KEXI
Classification: Applications
Component: Reports and Printouts (show other bugs)
Version: 2.4 alpha2 (Calligra 2.4 alpha2)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Adam Pigg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-13 23:05 UTC by Dimitrios T Tanis
Modified: 2012-08-11 11:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.4 (Calligra 2.4)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitrios T Tanis 2011-07-13 23:05:12 UTC
Version:           2.4 alpha2 (Calligra 2.4 alpha2) (using KDE 4.6.0) 
OS:                Linux

Trying to set a field's data source to a calculated value, results in international characters displaying jibrish.

Reproducible: Always

Steps to Reproduce:
Add a field on a report.
set the field's data source to ="JIM"
(include equal sign and quotes)

Add another field on the same report.
set the field's data source to ="ΔΗΜΗΤΡΙΟΣ"
(include equal sign and quotes, that is Greek for Jim by the way)

Show Data view.

Actual Results:  
The first field with Jim shows OK but the other with ΔΗΜΗΤΡΙΟΣ shows jibrish.
Mixed English with International character, shows the English ones OK, international jibrish.

Expected Results:  
Field's data source, calculated or not should display international characters correctly.

On an irrelevant note. TextBox doesn't allow it's data source to be edited by hand, only permits a choice from the list. Maybe you should change that?
Comment 1 Adam Pigg 2011-07-22 14:11:01 UTC
I believe this is related to Kross::action::evaluate() taking a QByteArray, therfore not supporting such characters.  Sebsauer, can you advise?
Comment 2 Sebastian Sauer 2011-07-22 16:02:47 UTC
When calling evaluated() it is needed to explicit convert the QString to a QByteArray using myString.toUtf8() (or the other way around using QString::fromUtf8) cause if it's done implicit then latin1 may be used. That's a rather common bug.

I would suggest to enable QT_NO_CAST_TO_ASCII and QT_NO_CAST_FROM_ASCII per default and would even go as far and would suggest to enable it for all of KDE per default (see also http://www.mail-archive.com/kde-buildsystem@kde.org/msg06033.html ).

So, either add
#define QT_NO_CAST_TO_ASCII
#define QT_NO_CAST_FROM_ASCII
to the code or something like (untested);
add_definitions(QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII)
to your cmake-file to figure out which places in reports may have problems with that.
Comment 3 Jarosław Staniek 2012-03-12 22:32:13 UTC
Git commit 8694fc63ae51f2f6f89514d5816187d8907cf2a5 by Jaroslaw Staniek.
Committed on 12/03/2012 at 23:28.
Pushed by staniek into branch 'master'.

Fixed displaying international characters in calculated values

Reports
*Fixed bug: setting a field's data source to a calculated value, results international characters not displaying correctly

M  +4    -0    kexi/doc/dev/CHANGELOG-Kexi-js
M  +6    -1    kexi/plugins/reports/krscriptfunctions.cpp
M  +5    -3    libs/koreport/renderer/scripting/krscripthandler.cpp

http://commits.kde.org/calligra/8694fc63ae51f2f6f89514d5816187d8907cf2a5
Comment 4 Jarosław Staniek 2012-03-12 22:52:52 UTC
Git commit 2bfb09220e0e61fbc03aa3606d53e21f14bd8374 by Jaroslaw Staniek.
Committed on 12/03/2012 at 23:28.
Pushed by staniek into branch 'calligra/2.4'.

Fixed displaying international characters in calculated values

Reports
*Fixed bug: setting a field's data source to a calculated value, results international characters not displaying correctly

M  +5    -0    kexi/doc/dev/CHANGELOG-Kexi-js
M  +6    -1    kexi/plugins/reports/krscriptfunctions.cpp
M  +5    -3    libs/koreport/renderer/scripting/krscripthandler.cpp

http://commits.kde.org/calligra/2bfb09220e0e61fbc03aa3606d53e21f14bd8374