how do we write unicode to file ? (help for diffeomorphic)
Padone
Posts: 3,686
Hi all, it seems we're not able to write unicode strings to file using the daz script. Below an example where I try to write to file the scene name that contains japanese characters. The string is good in the dialog box but it gets converted to ???? when I write it to file. I checked with an hex editor.
Can anyone please help ? We may need to write to file unicode strings in certain cases, for example to properly export the scene labels in unicode format.
string.jpg
708 x 306 - 53K
hex.jpg
446 x 146 - 32K
Post edited by Padone on
Comments
Daz docs says strings do support Unicode chars.
http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/string
This is the DAZScript counterpart to the QString type used in the DAZ Studio SDK.
A string is a sequence of zero or more Unicode characters.
But, I don't think you should assume it will write out a UTF16 encoded text file.
If you really want to preserve the text, then you should consider encoding it to UTF8 before writing it out, as there doesn't seem to be anyway to change the file output encoding other than ANSI.