#include <nglStringConv.h>
Inheritance diagram for nglStringConv:

To convert from a given encoding to another one, you have to setup a nglStringConv object. You can then process any chunk of text data with multiple calls to Process(). Note that converting is not a trivial job and many errors can arise. See Process() documentation for more info.
Most of the time, you will just want to important a text using a foreign locale into a nglString object, or the opposite, export into a foreign locale from a nglString object. The nglString::Import() and nglString::Export() methods will provide you an easy and convenient way to do this.
Public Member Functions | |
| nglStringConv (nglTextEncoding From, nglTextEncoding To, nglChar Default=nglStringConv::mUnknown) | |
| virtual | ~nglStringConv () |
| int | Process (const char *&pSource, int &rToRead, char *&pTarget, int &rToWrite) |
Static Public Attributes | |
| static nglChar | mUnknown |
|
||||||||||||||||
|
Create a conversion context
|
|
|
|
|
||||||||||||||||||||
|
Process with conversion
pSource to pTarget. Both rToRead and rToWrite values are updated to reflect respectively the number of bytes left to read and the number of bytes that can be still written. Any conversion error (either an illegal input sequence or an inconvertible sequence) is replaced with the default char passed to the constructor. You must check GetError() after this call to resolve the different issues that may arise. |
|
|
Default char used to mark in place a conversion error. Unused if set to '\0'.
|
1.4.1