Bug 331769 - Umbrello does not display chinese encoded rational rose files
Summary: Umbrello does not display chinese encoded rational rose files
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Unclassified
Component: general (show other bugs)
Version: 2.12.2
Platform: unspecified Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-05 15:02 UTC by Ralf Habacker
Modified: 2014-03-12 07:38 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.12.3


Attachments
chinese encoded rational rose import (10.52 KB, application/octet-stream)
2014-03-05 15:02 UTC, Ralf Habacker
Details
chinese encoded rational rose import (145.46 KB, application/octet-stream)
2014-03-05 15:08 UTC, Ralf Habacker
Details
CharacterSet enum from Microsoft.DirectX.Direct3D (1.16 KB, text/plain)
2014-03-08 18:49 UTC, Oliver Kellogg
Details
/tmp/qtextcodec-1.txt (1.48 KB, text/plain)
2014-03-09 20:55 UTC, Ralf Habacker
Details
untested patch to umbrello/import_rose.cpp (2.91 KB, patch)
2014-03-12 05:37 UTC, Oliver Kellogg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2014-03-05 15:02:19 UTC
Importing a chinese  (GB18030)  encoded rational rose file results into bad class and other names.  

Reproducible: Always

Steps to Reproduce:
1. start umbrello 
2. open appended file

Actual Results:  
class and other names in the tree view do not show chinese characters

Expected Results:  
chinese characters should be displayed
Comment 1 Ralf Habacker 2014-03-05 15:02:56 UTC
Created attachment 85422 [details]
chinese encoded rational rose import
Comment 2 Ralf Habacker 2014-03-05 15:03:49 UTC
Git commit dbb9a16a5ffc075f97d26a774fe923adc234305f by Ralf Habacker.
Committed on 05/03/2014 at 14:58.
Pushed by habacker into branch 'master'.

Add support for importing chinese (GB18030) encoded rational rose files.

M  +13   -1    umbrello/import_rose.cpp

http://commits.kde.org/umbrello/dbb9a16a5ffc075f97d26a774fe923adc234305f
Comment 3 Ralf Habacker 2014-03-05 15:04:22 UTC
Git commit ec7781125688e69776efec64c24700c87edf9e90 by Ralf Habacker.
Committed on 05/03/2014 at 14:58.
Pushed by habacker into branch 'KDE/4.13'.

Add support for importing chinese (GB18030) encoded rational rose files.
FIXED-IN:4.13.0
(cherry picked from commit dbb9a16a5ffc075f97d26a774fe923adc234305f)

M  +13   -1    umbrello/import_rose.cpp

http://commits.kde.org/umbrello/ec7781125688e69776efec64c24700c87edf9e90
Comment 4 Ralf Habacker 2014-03-05 15:05:35 UTC
Git commit caea26652c5c920653e3d0fa4c82e7eb9e7a0dff by Ralf Habacker.
Committed on 05/03/2014 at 14:58.
Pushed by habacker into branch 'KDE/4.12'.

Add support for importing chinese (GB18030) encoded rational rose files.
FIXED-IN:4.12.3
(cherry picked from commit dbb9a16a5ffc075f97d26a774fe923adc234305f)

M  +13   -1    umbrello/import_rose.cpp

http://commits.kde.org/umbrello/caea26652c5c920653e3d0fa4c82e7eb9e7a0dff
Comment 5 Ralf Habacker 2014-03-05 15:08:12 UTC
Created attachment 85424 [details]
chinese encoded rational rose import

previous one was already overwritten by umbrello
Comment 6 Oliver Kellogg 2014-03-08 18:49:44 UTC
Created attachment 85481 [details]
CharacterSet enum from Microsoft.DirectX.Direct3D

(In reply to comment #5)
> Created attachment 85424 [details]
> chinese encoded rational rose import
> 
> previous one was already overwritten by umbrello

Looking at the start of your attachment,

(object Petal
    version    	50
    _written   	"Rose 2006.0.0.060314"
    charSet    	134)

This "charSet" value got me thinking.
Looking at the charSet in other publicly available Rose MDL files, the values used by Rose appear to conform with these here:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb322881%28v=vs.85%29.aspx
Perhaps this might help for mapping the other supported character sets.
Comment 7 Ralf Habacker 2014-03-09 20:55:41 UTC
Created attachment 85497 [details]
/tmp/qtextcodec-1.txt

List of available QTextCodec codecs, which need to be mapped to the charset value.
Comment 8 Oliver Kellogg 2014-03-12 05:37:58 UTC
Created attachment 85549 [details]
untested patch to umbrello/import_rose.cpp

This patch tries to map attachment 85424 [details] (CharacterSet values) to attachment 85481 [details] (QTextCodecs).
Please review.
Comment 9 Ralf Habacker 2014-03-12 07:38:40 UTC
Comment on attachment 85549 [details]
untested patch to umbrello/import_rose.cpp

+                    if (charSet == "0")         // ASCII
+                        ;
by default ISO-8859-1 is set, no problem here to use it ? 
+                        ; // @todo stream.setCodec("what");
better to use a uWarning() or uError() message ? 
+   stream.setCodec("GB18030");  // TBC: Shouldn't this be GB2312 ?
from http://en.wikipedia.org/wiki/GB_18030
GB18030 is the registered Internet name for the official character set of the People's Republic of China (PRC) superseding GB2312. 

Any idea where to get more rose example files for further verifing ? 
I found some ascii encoded examples at http://crazybeans.cvs.sourceforge.net/viewvc/crazybeans/CrazyBeans/examples/