几何尺寸与公差论坛------致力于产品几何量公差标准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-06, 09:11 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】odstring unicodemif behaviour on pc and mac

odstring unicode/mif behaviour on pc and mac
odstring unicode/mif behaviour on pc and mac
hi everybody,
i create an odstring from katakana characters from the codepage ansi 932 like below:
const char characters[9] = { 0x83, 0x4f, 0x83, 0x8b, 0x81, 0x5b, 0x83, 0x76, 0x00 };
odstring string(characters, cp_ansi_932);
const odchar * unicode = string.c_str(); // unicode buffer
const char * ansi = static_cast<const char *>(string); // ansi buffer
on the pc "ansi" contains the "characters" above and "unicode" contains the utf-16 codes 0x30b0 ...
on the mac "ansi" and "unicode" contains the mif representation \m+1834f ...
why is the behaviour on the pc and mac different?
is it possible to get the same behaviour from the pc on the mac?
thanks a lot.
hello speed,
you need initialize codepage convertion table for cp_ansi_932 on the mac. see for example
and
best regards,
sergey z.
i am reading a dxf file with oddbdocument::readfile and in the dxf file there are strings encoded in ansi 932. all strings from the dxf file will be stored in an odstring by the opendwg library.
i thought odstring is handling all the code page issues and returns me an unicode string on pc and mac.
how should i initialize codepage conversion to cp_ansi_932 when the information which codepage is used,
is buried somewhere in the dxf file. with a different file, it could be a different codepage.
i might probably misunderstood something here.
i am still wondering why the behaviour is different on the pc and mac.
thanks,
ralf
hello ralf,
codepage conversion works properly when odcodemapper class is initialize.
you have to do it once during start application.
for example:
#include "odcharmapper.h"
...
void main(...)
{
odcharmapper::initialize("c:\\adinit.dat");
...
}
file "adinit.dat" you can find in c dwg library (open dwg toolkit).
also use searching with "adinit.dat" on forum for more information.
best regards,
sergey z.
hello sergey,
thank you very much for your help. i got it running on mac os x now besides the following:
i am calling readfile with an odstring storing a fullpath to a dxf file "む.dxf" where one character is
the unicode character 0x3080 but readfile never returns and hangs forever. the exactly same dxf
file e.g. "a.dxf" with all ascii characters and no unicode characters works just fine.
this happens on mac os x with dwgdirect library 2.05.01, 2.06.03, 2.07.01. its fine on win32.
am i still missing something.
thanks a lot.
ralf
hello sergey,
do you have any information about the problem, i have described below.
this is very important for our customer.
thanks,
ralf
hello ralf,
it seems where is problem with system create file. try to chech your implementation oddbsystemservices::createfile() method.
best regards,
sergey z.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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



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


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