几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-05-04, 07:28 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】different rendering of text between japanese and english os

different rendering of text between japanese and english os
different rendering of text between japanese and english os windows xp
hello
i have problem with rendering text at the japanese windows - reading dxf file.
string is \u+3072\u+3068\u+3064\u+3084\u+3063\u+3066\u+307f\ u+3088\u+3046
code page in a dxf file ia ansi_1252
very simpele code i am using:
odstring str(pdiment->dimensiontext(),pdb->getdwgcodepage());
and results are:
1) at english windows is ok, string is
ansistring "\u+3072\u+3068\u+3064\u+3084\u+3063\u+3066\u+307f \u+3088\u+3046" and this is ok, because code_page in not 932 and this text is japanese
unicodebuffer contain correct unicode string and i can see him
2) at japanese windows results are not ok
ansistring "?#272;?#262;偮傗偭偰傒?#263;偆"
unicodebuffer "?侫偮傗偭偰傒俛偆
these strings at ansi and unicode buffer form my side does not look like at anything seems like my japanese string.
can somebody explan to me these differences between japanese and english and generaly what dwgdirect++ library checking at different operation systems. i didnt check any other windows, like germany locale windows xp, like croatian windows xp locale, serbian, rusian..., this is all locale unicode supported.
best regards
ervin
hello ervin,
odstring str(pdiment->dimensiontext(),pdb->getdwgcodepage());
this constructor definition is
odstring:dstring(const char* str, odcodepageid codepage)
so
1. pdiment->dimensiontext() is converted to multi byte with system code page (more exactly cp_thread_acp)
2. this multi byte string with pdb->getdwgcodepage() is used for initialize variable "str".
pdiment->dimensiontext() returns odstring so it must be in unicode.
test next str
odstring str(pdiment->dimensiontext());
is unicode right in both locale (japanese and english)?
test next strings
odansistring ansistr932(str, cp_ansi_932); // must be multibyte
odansistring ansistr1252(str, cp_ansi_1252); // must be \u+xxxx notation
best regards,
sergey z.
hello sergey
i checked again with your proposal, but i have same thing, something do not work correct at japanese winxp.
i need correct unicode buffer that i can operate with strings in my application.
what i have from dwgdirect at japane winxp is wrong wrong.
i changed my code to:
odansistring ansistr(pdiment->dimensiontext(),cp_ansi_1252);
odstring str(ansistr);
and i have for a string
1) at english winxp
"\u+3072\u+3068\u+3064\u+3084\u+3063\u+3066\u+ 307f \u+3088\u+3046"
2) at japanese winxp
"?#272;?#262;偮傗偭偰傒?#263;偆" - this is garbage
i remaind that my dxf file has a dimension texts (japanese and german) and has for code_page ansi_1252.
with this code page, all japanese texts must to have u+xxxx notation in a ansi buffer of odstring, german (umalut) chars must have original value in ansi buffer of odstrinig, because german chars are in range of ansi_1252, and everything have to work same at both of operations systems (janapese and english winxp).
can you please check this issue, becuse, it is urgen for my customers.
i attached dxf file.
best regards
ervin
attached files (46.3 kb, 3 views)

hello ervin,
quote:
2) at japanese winxp
"??????#8218;?#8218;?#8218;?#8218;?#8218;???quot; - this is garbage
it is seems correct multi byte value (in cp 932) for unicode srting (\u+xxxx...). (hex format would be more suitable.)
it very strange what you get this with code page 1252 (odansistring ansistr(pdiment->dimensiontext(),cp_ansi_1252)).
what version dwgdirect do you use?
i am getting at both of operations systems (janapese and russian winxp).
odansistring ansstr(str, cp_ansi_932); // "??????#8218;?#8218;?#8218;?#8218;?#8218;???quot;
odansistring ansstr1(str, cp_ansi_1252); // u+xxxx
if i understand right you need to get ansi text string from pdiment->dimensiontext().
note
this two lines have no sence:
odansistring ansistr(pdiment->dimensiontext(),cp_ansi_1252);
odstring str(ansistr);
and it may be changed to ( no need any conversion)
odstring str(pdiment->dimensiontext());
best regards,
sergey z.
last edited by sergey z.; 25th january 2008 at 07:23 amfff">.
hello sergey.
ok, i understand, what you tell me.
my question is:
why at jap winxp in ansi buffer i have multibyte representation of string and at eng winxp i have \u+xxxx in ansi buffer of odstring class for a same text. unicode buffer is ok at the both of operations systems.
in dxf file is a ansi_1252 code page. is there a way how can i have always same ansi buffer at the different operations sistem, or any triks or something else !?
best regards
ervin
hello ervin,
i am not able to reproduce your situation. i have always same ansi buffer at the different operations sistem. so possible you use not last version dwgdirect.
note. try to check code page pdb->getdwgcodepage(). in case it is equal cp_undefined it is used system code page in conversion.
best regards,
sergey z.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭



所有的时间均为北京时间。 现在的时间是 01:25 PM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多