|
高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】reading of dxf without dwgcodepage
reading of dxf without "$dwgcodepage"
reading of dxf without "$dwgcodepage"
dear sir.
i want to read dxf without "$dwgcodepage" correctly.
when dd1.1 was used, i was able to read it correctly.
when dd2.2 is used, i cannot correctly read it.
when "oddbdatabase" is newly made by "oddbhostappservices::readfile()", "cp_dos932" is correctly set in the codepage of "oddbdatabase".
however, when dxf without "$dwgcodepage" is read, "cp_undefined" is set in codepage of "oddbdatabase".
the read mbcs(shift-jis) character string is converted by using "cp_undefined".
and, the character converted by mistake is stored in the database.
i want to acquire the character string before it is converted.
or, when dxf without "$dwgcodepage" is read, i expect to be converted by the default codepage(cp_dos932).
please teach me if there is something a good method.
yours very sincerely.
attached files
hello hidekiyo,
really it is bug in dwgdirect. dwgcodepage must initialize by system codepage when file isn't contain it. it will be fixed in next release. thank you for report.
quote:
i want to acquire the character string before it is converted.
the odstring has unicode and ansi string copy. so you may get ansi copy source string before some changing it.
best regards,
sergey z.
dear sergey.
thank you for your answer.
i challenged to get of ansi copy.
but it was not obtained, because the ansistring member of odstring was null.
i think that i wait for the next release.
by the way, i want me to teach about when the next release seems to be fixd.
sincerely.
hi sergey,
this is a problem for us as well. but it can be a bit more complicated than that, because getting a clue to the codepage from the system is sometimes misleading. this is the case e.g. in greece for more than one reason:
1. the greek mac os is actually a patched western system. while it is localized to greek language and uses fonts supporting greek letters, if you query it from code it returns that it is mac-roman, not greek.
2. lots of our greek users exchange data with no real autocad but antique programs that know only r12 dxf format (and maybe dwg too) - so there is no dwgcodepage info in their files. it wouldn't be a problem in itself, but they run on pcs set to some old msdos codepage or another (maybe 437).
we have a lot of character conversion problems specific to them due to these problems - and (2) occurs in other countries as well.
so i have a little idea to allow the caller to override the default codepage gained from the system. it wouldn't be necessary to do so; on the other hand it could be called any number of times (as required by the incoming data). a static member of e.g. oddbdatabase could do the job. what do you think?
one more thing: could you please aid me in fixing just this one bug in our 2.2.0 source? the reason is i don't think we'll get permission to incorporate the next dd release in the archicad release we are working on at the moment - and i don't think we could get away without fixing it either.
best regards
tibor
last edited by horvath tibor; 7th february 2007 at 02:15 amfff">.
hi tibor,
quote:
originally posted by horvath tibor
so i have a little idea to allow the caller to override the default codepage gained from the system. it wouldn't be necessary to do so; on the other hand it could be called any number of times (as required by the incoming data). a static member of e.g. oddbdatabase could do the job. what do you think?
tibor
dwgdirect gets system codepage via oddbsystemservices (method systemcodepage()). your can overrider it in your application.
best regards,
sergey z.
hi sergey,
thank you, i will.
best regards
tibor
|