how to determine character set when called
how to determine character set when called
when you derive functions like findfile() and accessfile() i assume you may be called both before and and after a dwg/dxf is loaded.
before a file is loaded, filenames for findfile() and accessfile() can be assumed to have the same codepage as the filenames entered to readfile(). which should be ==systemcodepage().
but when you are loading/processing a dwg, then the xrefs, fonts and other file paths may be stored in another codepage. when you get called in your findfile() implementation for an xref, what can be assumed about the codepage? have the toolkit converted the filenames to systemcodepage() before it calls findfile()?
is the textproc()'s msg parameter in the dwgs codepage or in systemcodepage()?
does readfile()' s allowcpconversion parameter actively convert all the strings in the dwg to systemcodepage() or does it simply make the dwgcodepage variable of the dwg rw?
and finally; can dwg files contain file names (xrefs etc) with out-of-8bit-codepage characters? how are they represented? ("\u+xxxx" etc?)
-rune jorgensen
www.dds.no
if ballowcpconversion parameter of readfile() is true dwgdirect converts text strings to system code page while loading the file. if the parameter is false the file is loaded as is. so if conversion was allowed findfile and accessfile will get strings in system code page.
but i just noticed that xref paths are not converted - this is bug. thank you for bringing attension to it. (fonts are ok).
in asian code pages (mbcs) a character can occupy 1 or 2 bytes. in single byte code pages characters which are absent in the code page can be represented by
\+mxxxxx or \+uxxxx sequences.
sergey slezkin
thanks for the clarifying answers!
-rune jorgensen
www.dds.no