Bug 135564 - kig garbles special characters
Summary: kig garbles special characters
Status: RESOLVED FIXED
Alias: None
Product: kig
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Pino Toscano
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-13 10:23 UTC by Jaka Kranjc
Modified: 2006-11-23 01:32 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
screenshot (74.85 KB, image/jpeg)
2006-10-13 10:24 UTC, Jaka Kranjc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaka Kranjc 2006-10-13 10:23:29 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 4.0.3 
OS:                Linux

I added some labels to a sketch and two of them contain the greek alpha symbol α. But after opening the file the next day, alpha is replaced by some other chars (capital i with circumflex and +/-).

If I remove the first (magic) line, file confirms the kig file is "UTF-8 Unicode text". Opening it shows the same two bad symbols:
<Data type="string" id="2" >α</Data>
<Data type="string" id="16" >2α</Data>

So I deduce that something is wrong before writing the file already. The fact that two chars replaced one maybe shows that kig interprets the multibyte unicode char as two singlebyte chars (both those chars are ascii).
Comment 1 Jaka Kranjc 2006-10-13 10:24:39 UTC
Created attachment 18105 [details]
screenshot
Comment 2 Jaka Kranjc 2006-10-13 13:57:19 UTC
it's not that simple:
α  03B1
--------
Î  00CE
±  00B1
Comment 3 Pino Toscano 2006-11-23 01:32:34 UTC
SVN commit 607078 by pino:

Do not silently convert to an encoding different than UTF-8 when saving.

BUGS: 135564


 M  +1 -1      native-filter.cc  


--- branches/KDE/3.5/kdeedu/kig/filters/native-filter.cc #607077:607078
@@ -665,7 +665,7 @@
   docelem.appendChild( windowelem );
 
   doc.appendChild( docelem );
-  stream << doc.toCString();
+  stream << doc.toString();
   return true;
 }
 
Comment 4 Pino Toscano 2006-11-23 01:32:44 UTC
SVN commit 607079 by pino:

Do not silently convert to an encoding different than UTF-8 when saving.

CCBUG: 135564


 M  +1 -1      native-filter.cc  


--- branches/kig/post-kde-3.5/kig/filters/native-filter.cc #607078:607079
@@ -719,7 +719,7 @@
   docelem.appendChild( windowelem );
 
   doc.appendChild( docelem );
-  stream << doc.toCString();
+  stream << doc.toString();
   return true;
 }
 
Comment 5 Pino Toscano 2006-11-23 01:32:55 UTC
SVN commit 607080 by pino:

Do not silently convert to an encoding different than UTF-8 when saving.

CCBUG: 135564


 M  +1 -1      native-filter.cc  


--- trunk/KDE/kdeedu/kig/filters/native-filter.cc #607079:607080
@@ -722,7 +722,7 @@
   docelem.appendChild( windowelem );
 
   doc.appendChild( docelem );
-  stream << doc.toByteArray();
+  stream << doc.toString();
   return true;
 }