In Hoops Publish API, every character string must be given as A3DUTF8Char*. However, when dealing with foreign characters such as Japanese or Russian ones, they are initially given as Unicode strings.
This article is showing how to convert Unicode strings to UTF8Char strings, to This article in our forum demonstrates how to display foreign characters in a PDF file .
Here is an example with a Japanese character string:
Allocate the destination string
Convert the Unicode string to the UTF8 one
Code Block wchar_t sString[] = L"新細明體"; A3DUTF8Char* pcDestString = new A3DUTF8Char[500]; A3DMiscUnicodeToUTF8((const A3DUTF8Char*)sString, pcDestString );
Now pcDestString can be used in any function or field data requiring a UTF8 string. And the Japanese characters will be displayed correctly in the PDF file.
Info |
---|
In Visual Studio, if a source file contains directly foreign characters, then the source file must be saved with a correct encoding, such as: Unicode (UTF-8 with signature) - Codepage 65001. |
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
hidden | true |
---|
...
by converting a Unicode string to a UTF8Char string.