Gnash  0.8.11dev
Namespaces | Enumerations | Functions
utf8.h File Reference
#include <string>
#include <cstdint>
#include <vector>
#include "dsodefs.h"

Go to the source code of this file.

Namespaces

 gnash
 Anonymous namespace for callbacks, local functions, event handlers etc.
 
 gnash::utf8
 Utilities to convert between std::string and std::wstring.
 

Enumerations

enum  gnash::utf8::TextEncoding {
  gnash::utf8::encUNSPECIFIED, gnash::utf8::encUTF8, gnash::utf8::encUTF16BE, gnash::utf8::encUTF16LE,
  gnash::utf8::encUTF32BE, gnash::utf8::encUTF32LE, gnash::utf8::encSCSU, gnash::utf8::encUTF7,
  gnash::utf8::encUTFEBCDIC, gnash::utf8::encBOCU1
}
 
enum  gnash::utf8::EncodingGuess { gnash::utf8::ENCGUESS_UNICODE = 0, gnash::utf8::ENCGUESS_JIS = 1, gnash::utf8::ENCGUESS_OTHER = 2 }
 

Functions

std::wstring gnash::utf8::decodeCanonicalString (const std::string &str, int version)
 Converts a std::string with multibyte characters into a std::wstring. More...
 
std::string gnash::utf8::encodeCanonicalString (const std::wstring &wstr, int version)
 Converts a std::wstring into canonical std::string. More...
 
std::uint32_t gnash::utf8::decodeNextUnicodeCharacter (std::string::const_iterator &it, const std::string::const_iterator &e)
 Return the next Unicode character in the UTF-8 encoded string. More...
 
std::string gnash::utf8::encodeUnicodeCharacter (std::uint32_t ucs_character)
 Encodes the given wide character into a canonical string, theoretically up to 6 chars in length. More...
 
std::string gnash::utf8::encodeLatin1Character (std::uint32_t ucsCharacter)
 Encodes the given wide character into an at least 8-bit character. More...
 
const char * gnash::utf8::stripBOM (const char *in, size_t &size, TextEncoding &encoding)
 Interpret (and skip) Byte Order Mark in input stream. More...
 
const char * gnash::utf8::textEncodingName (TextEncoding enc)
 Return name of a text encoding. More...
 
EncodingGuess gnash::utf8::guessEncoding (const std::string &s, int &length, std::vector< int > &offsets)
 Common code for guessing at the encoding of random text, between. More...