SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWFromUTF8Converter Class Reference

Converts char, RWCString or std::string UTF-8 values to UTF-16. More...

#include <rw/stream/RWFromUTF8Converter.h>

Public Member Functions

void convert (char from, RWUChar &to)
 
void convert (char from, RWWString &to)
 
void convert (char from, wchar_t &to)
 
void convert (const char *from, size_t len, RWWString &to)
 
void convert (const RWCString &from, RWWString &to)
 
void convert (const std::string &from, RWWString &to)
 

Detailed Description

RWFromUTF8Converter converts char, RWCString or std::string UTF-8 values to UTF-16. The character or string to be converted must be encoded in UTF-8. To translate other encodings, use converters supplied by the Internationalization Module. All characters or strings must contain complete UTF-8 characters. Partial encodings will result in the converter throwing an RWExternalStreamException.

Member Function Documentation

◆ convert() [1/6]

void RWFromUTF8Converter::convert ( char from,
RWUChar & to )

Converts a single byte UTF-8 char to UTF-16 encoded RWUChar.

Parameters
fromcontains the UTF-8 character to convert
toreturns the resulting UTF-16 character

◆ convert() [2/6]

void RWFromUTF8Converter::convert ( char from,
RWWString & to )

Converts a single byte UTF-8 char to a UTF-16 encoded RWWString.

◆ convert() [3/6]

void RWFromUTF8Converter::convert ( char from,
wchar_t & to )

Converts a single byte UTF-8 char to UTF-16 encoded wchar_t.

◆ convert() [4/6]

void RWFromUTF8Converter::convert ( const char * from,
size_t len,
RWWString & to )

Converts one or more UTF-8 chars to a UTF-16 encoded RWWString.

◆ convert() [5/6]

void RWFromUTF8Converter::convert ( const RWCString & from,
RWWString & to )
inline

Converts a UTF-8 encoded RWCString to a UTF-16 encoded RWWString.

◆ convert() [6/6]

void RWFromUTF8Converter::convert ( const std::string & from,
RWWString & to )
inline

Converts a UTF-8 encoded std::string to a UTF-16 encoded RWWString.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.