高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】german characters, export in dxf
german characters, export in dxf
german characters, export in dxf
helloo
i have a question about germany chars (umlaut chars) 淠e鲋?
i want these chars stored in a dxf file but not in a \u+xxxx and \m+xxxx notation, only as a roman8 encoding (in a original form).
my application manipulate with japanese (sjis) and umlaut chars (roman8).
everything what i made for a japanese (sjis) chars does not work for a umlaut chars.
i prepared all my string in odansistring with code page cp_ansi_932 and give these objects to the dwgdirect library.
i also set generaly code page for hole dxf file to the cp_ansi_932, and everything work fine with japanesse chars (sjis encoded). my texts in dxf file when i exporting to the dxf file was stored as a multibyte and not in a \m+xxxx - that is what i want.
now if i have germany chars, nothing work correctly. at all placese where are germany chars, i have \u+xxxx notation, why that ?
i know that, cp_ansi_932 is not correct code_page for umlaut char, cp_ansi_1252 is (i think).
example:
odcharmapper::widechartomultibyte(cp_ansi_932,wcha t_tmp.asarrayptr(),wcslen(wchat_tmp.asarrayptr()), char_tmp);
with this example, if i have japanese chars, this function return correct value
if i have a umlaut chars, this function return \u+xxxx why that, this is converting to the mulibyte not to the unicode. with japanese, it is correct !
if i set another code page - cp_ansi_1252, with umlaut chars everythins is ok, but with japanese nothing, they are \u+xxxx again - i do not want that.
i remind that when it was dwgdirect library version1.xxxx (befeore unicode support) everythings work correctly.
now i have only troubles with these code pages and notations (\u+xxxx and \m+xxxx). i do not want these notations, i want original text in dxf file as i fullfill in dwgdirect entity !
i am upgrading my app with newest dwgdirects library and only have a problmes, and problems ! hah.
can someone explane to me with more details, which code page i have to set for hole dxf file, that ia can store japanese chars and unlaut chars (i remaind that i want it as a asci chars, do not want notations \u+ and \m+).
how i have to prepare my char pointers ? in my app all texts are handled as char *. i was trying with odansistring(char_pointer,some_code_page), but does not work with mix japanese and umlaut char. (sjis and roman8) !
kind regards
ervin
in old dwg/dxf versions strings were stored in mbcs according to drawing's code page. conversion was required only if you load a drawing of foreign code page. in latest dwg versions and at run-time (both autocad's and dwgdirect) all strings are stored in unicode and in latest dxf - in utf8. so while loading/saving dxf conversion is always performed.
all strings in older dwg files and dxf are assumed to be in drawing's code page. the only exception is mtext contents where font and charset can be switched in the middle of a string.
why it "worked previously"? it worked only if you load a drawing with the same code page as your computer has because no code page conversion was performed.
it's impossible to have strings in different code pages within the same drawing except mtext case mentioned above.
if you save a drawing in 932 code page and a 1252 character can't be converted to 932 cp than it's saved as \+uxxxx sequence.
this is not oda who decided to store unicode strings in dwg...
sergey slezkin
|