![]() |
【转帖】codepage conversion
codepage conversion
codepage conversion i'm trying to build the odcopyex application with codepage conversion. i changed the call to read the file to: pdb = svcs.readfile(argv[1], true); // true == codepageconversion this works perfectly for windows, but for hp-ux the codepage is cp_undefined and so the result is bad. but if i manually change the default value in exsystemservices::exsystemservices() to cp_ansi_1252 or to cp_8859_1 it doesn't work either. is this feature supported on unix? regards do you mean you have overridden oddbsystemservices::systemcodepage() and it does not work? on windows default implementation of this function returns current code page and on other platforms - undefined. sergey slezkin quote: originally posted by sergey slezkin do you mean you have overridden oddbsystemservices::systemcodepage() and it does not work? on windows default implementation of this function returns current code page and on other platforms - undefined. the problem is i have a dwg file which has as $dwgcodepage ansi_1251 (kyrillic) and want a dxf file with ansi_1252. by using the windows build of the modified odcopyex the codepage is changed to ansi_1252 and the kyrillic characters are replaced with their correct unicode values (eg \u+0411). by using the hp-ux build using following modification of exsystemservices.cpp the codepage is also changed to ansi_1252 (tried also cp_8859_1) but the kyrillic characters are replaced with wrong unicode values (eg \u+00fc). before: exsystemservices::exsystemservices() : m_codepageid(cp_undefined) { #ifdef _win32 ... #endif } after: exsystemservices::exsystemservices() : m_codepageid(cp_ansi_1252) // or cp_8859_1 { #ifdef _win32 ... #endif } 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). -- best regards, sergey zaitcev quote: originally posted by sergey z. 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). -- best regards, sergey zaitcev hello this doesn't work as expected on hp-ux. attached you will find the changed sourcecode of odcopyex.cpp and a dwg file in ansi_1251. if i convert the file to dxf using this modified odcopyex all cyrillic characters are converted to wrong unicode values. regards adolf mollnhuber attached files (6.3 kb, 20 views) your code is right. there is a problem with supporting big-endian byte ordering for odcharmapper class in dwgdirect. it will be fixed in next version. thanks you for report. -- best regards, sergey zaitcev |
所有的时间均为北京时间。 现在的时间是 04:14 AM. |