We really need the encoding of the string being stored, to avoid unneeded conversions (injson/indxf e.g. r2007 -> r2000), and while we are there we can also store the length then.
cp being dwg->header.codepage (eg 30) or 0: UTF8 (indxf + injson) or 43 UTF-16 (TU) or CP_DWG (lookup dwg->header.codepage).
Then we can add iconv conversions also. So far only US_ASCII and Latin-1 (cp 30) conversions are done properly.
But better embed the string at the end of the string and pass around the ptr to this.
We really need the encoding of the string being stored, to avoid unneeded conversions (injson/indxf e.g. r2007 -> r2000), and while we are there we can also store the length then.
cp being dwg->header.codepage (eg 30) or 0: UTF8 (indxf + injson) or 43 UTF-16 (TU) or CP_DWG (lookup dwg->header.codepage). Then we can add iconv conversions also. So far only US_ASCII and Latin-1 (cp 30) conversions are done properly.
But better embed the string at the end of the string and pass around the ptr to this.
The other idea is to use UTF-8 everywhere and convert on the fly.