#include <Pt/Utf8.h>
UTF-8 string converter. More...
Public Member Functions | |
| Utf8Convert (TextCodec< Char, char > *codec) | |
| Construct with codec. | |
| ~Utf8Convert () | |
| Destructor. | |
| std::string | fromBytes (const char *bytes, std::size_t n) |
| Decode from external encoding. | |
| std::string | fromBytes (const std::string &bytes) |
| Decode from external encoding. | |
| std::string | toBytes (const char *utf8, std::size_t n) |
| Encode to external encoding. | |
| std::string | toBytes (const std::string &bytes) |
| Encode to external encoding. | |
Utf8Convert converts between strings in external encodings and UTF-8. It uses a fixed internal buffer for the conversion, so temporary allocations are not performed. A Wave::TextCodec facet is used for the actual conversion. It can either be default constructed with new and ownership is passed to the Utf8Convert or with a refcount greater than 0, which indicates ownership by the caller.