Bug 331769

Summary: Umbrello does not display chinese encoded rational rose files
Product: umbrello Reporter: Ralf Habacker <ralf.habacker>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: normal CC: okellogg
Priority: NOR    
Version: 2.12.2   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 4.12.3
Attachments: chinese encoded rational rose import
chinese encoded rational rose import
CharacterSet enum from Microsoft.DirectX.Direct3D
/tmp/qtextcodec-1.txt
untested patch to umbrello/import_rose.cpp

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/