Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
utf8.h File Reference
#include <string>
Include dependency graph for utf8.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  ERR
 

Functions

std::wstring wstring_from_utf8 (const std::string &s, Status *err=0)
 convert UTF-8 to a wide string (UTF-16 or UCS-4, depending on the platform's wchar_t). More...
 
std::string utf8_from_wstring (const std::wstring &s, Status *err=0)
 opposite of wstring_from_utf8 More...
 

Variables

const Status ERR::UTF8_SURROGATE = -100700
 
const Status ERR::UTF8_OUTSIDE_BMP = -100701
 
const Status ERR::UTF8_NONCHARACTER = -100702
 
const Status ERR::UTF8_INVALID_UTF8 = -100703
 

Function Documentation

◆ utf8_from_wstring()

std::string utf8_from_wstring ( const std::wstring &  s,
Status err = 0 
)

opposite of wstring_from_utf8

◆ wstring_from_utf8()

std::wstring wstring_from_utf8 ( const std::string &  s,
Status err = 0 
)

convert UTF-8 to a wide string (UTF-16 or UCS-4, depending on the platform's wchar_t).

Parameters
sinput string (UTF-8)
errif nonzero, this receives the first error encountered (the rest may be subsequent faults) or INFO::OK if all went well. otherwise, the function raises a warning dialog for every error/warning.