XMLTextEncoding(3)

XMLTextEncoding(3) Library Functions Manual XMLTextEncoding(3)

NAME

XMLTextEncoding - The XMLTextEncoding class.

SYNOPSIS

#include <XMLTextEncoding.h>

Static Public Member Functions


static std::string detectDocumentEncoding (const std::string &document)
Detects XML document encoding. static std::vector< std::string > detectStringEncoding (const std::string &str, const bool &filter=bool(false))
Detects text string encoding. static void convertToEncoding (const std::string &source, std::string &result, const std::string &source_code_page, const std::string &result_code_page)
Converts string from one encoding to another.

Detailed Description

The XMLTextEncoding class.

This class contains methods for text encodings processing. Some of these methods are suitable not only for XML documents, but also for any text strings.

Member Function Documentation

void XMLTextEncoding::convertToEncoding (const std::string & source, std::string & result, const std::string & source_code_page, const std::string & result_code_page) [static]

Converts string from one encoding to another.

Parameters

source String to be converted.
result Result of conversion (emty in case of any errors).
source_code_page Code page of source string (if empty, default system encoding is used).
result_code_page Desired code page of resylt string (if empty, resylt will use default system encoding).

std::string XMLTextEncoding::detectDocumentEncoding (const std::string & document) [static]

Detects XML document encoding. This method tries to detect encoding from the XML header. If operation was not successfull, tries to detect encoding by ICU library methods.

Parameters

document String, containing XML document.

Returns

Text code page. Empty in case of any errors.

std::vector< std::string > XMLTextEncoding::detectStringEncoding (const std::string & str, const bool & filter = bool(false)) [static]

Detects text string encoding.

Parameters

str String text encoding to be detected in.
filter If true, algorithm ignores html and xml tags.

Returns

Vector with all found encoding names. First element in vector is most suitable result (see ICU documentation for details).

Author

Generated automatically by Doxygen for XMLParserCPP from the source code.

Version 1.1 XMLParserCPP