This class deals with character encoding/decoding.
More...
#include <CharEncodingConv.h>
This class deals with character encoding/decoding.
Definition at line 80 of file CharEncodingConv.h.
It prepare sthe conversion from a charset code to another one.
The name of the origen charset of the string to be converted to destiny charset. The name of the destiny charset of the string to be converted.
te::common::CharEncodingConv::~CharEncodingConv |
( |
| ) |
|
Copy constructor not allowed!
std::string te::common::CharEncodingConv::conv |
( |
const std::string & |
src | ) |
|
It converts the source string to a target charset.
- Parameters
-
src | The string in a source charset. |
- Returns
- The string converted to the destiny charset.
- Exceptions
-
Exception | It throws an exception if the conversion can not be done. |
- Note
- This method tries to cache the internal encoder/decoder machine.
-
Once an exception is thrown the converter object can not be used anymore because it can be in an state that can not be used to convert text anymore.
static std::string te::common::CharEncodingConv::convert |
( |
const std::string & |
src, |
|
|
const CharEncoding & |
fromCode, |
|
|
const CharEncoding & |
toCode |
|
) |
| |
|
static |
An static method that converts the source string to a target charset.
- Parameters
-
src | The string in a source charset. |
fromCode | The name of the origen charset of the string to be converted to destiny charset. |
toCode | The name of the destiny charset of the string to be converted. |
- Returns
- The string converted to the destiny charset.
- Exceptions
-
Exception | It throws an exception if the conversion can not be done. |
- Note
- This method doesn't cache the internal encoder/decoder machine.
static std::string te::common::CharEncodingConv::getCharEncodingName |
( |
const CharEncoding & |
code | ) |
|
|
static |
It returns the name of the given charset.
- Parameters
-
- Returns
- The name of the given charset.
static CharEncoding te::common::CharEncodingConv::getCharEncodingType |
( |
const std::string & |
name | ) |
|
|
static |
It returns the charset type of the given charset name.
- Parameters
-
- Returns
- The type of the given charset.
static void te::common::CharEncodingConv::initialize |
( |
| ) |
|
|
static |
It initializes the CharEncoding Converter.
Assignment operator not allowed!
iconv_t te::common::CharEncodingConv::m_cd |
|
private |
The iconv state machine used to convert string from one character to another one.
Definition at line 158 of file CharEncodingConv.h.
std::map<CharEncoding, std::string> te::common::CharEncodingConv::sm_encodingNames |
|
staticprivate |
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_master/terralib5/src/terralib/common/CharEncodingConv.h