LibreOffice: _rtl_TextEncodingInfo Struct Reference

LibreOffice LibreOffice 5.0 SDK C/C++ API Reference

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Attributes | List of all members
_rtl_TextEncodingInfo Struct Reference

Information about a text encoding. More...

`#include <tencinfo.h>`

## Public Attributes
sal_uInt32 | StructSize
| The size (in bytes) of this structure. More...
sal_uInt8 | MinimumCharSize
| The minimum number of bytes needed to encode any character in the given encoding. More...
sal_uInt8 | MaximumCharSize
| The maximum number of bytes needed to encode any character in the given encoding. More...
sal_uInt8 | AverageCharSize
| The average number of bytes needed to encode a character in the given encoding. More...
sal_uInt8 | Reserved
| An unused byte, for padding. More...
sal_uInt32 | Flags
| Any combination of the RTL_TEXTENCODING_INFO flags. More...

## Detailed Description

Information about a text encoding.

## Member Data Documentation

sal_uInt8 _rtl_TextEncodingInfo::AverageCharSize

The average number of bytes needed to encode a character in the given encoding.

sal_uInt32 _rtl_TextEncodingInfo::Flags

Any combination of the RTL_TEXTENCODING_INFO flags.

RTL_TEXTENCODING_INFO_CONTEXT: The encoding uses some mechanism (like state-changing byte sequences) to switch between different modes (e.g., to encode multiple character repertoires within the same byte ranges).

Even if an encoding does not have the CONTEXT property, interpretation of certain byte values within that encoding can depend on context (e.g., a certain byte value could be either a single-byte character or a subsequent byte of a multi-byte character). Likewise, the single shift characters (SS2 and SS3) used by some of the EUC encodings (to denote that the following bytes constitute a character from another character repertoire) do not imply that encodings making use of these characters have the CONTEXT property. Examples of encodings that do have the CONTEXT property are the ISO-2022 encodings and UTF-7.

RTL_TEXTENCODING_INFO_ASCII: The encoding is a superset of ASCII. More specifically, any appearance of a byte in the range 0x20–7F denotes the corresponding ASCII character (from SPACE to DELETE); in particular, such a byte cannot be part of a multi-byte character. Note that the ASCII control codes 0x00–1F are not included here, as they are used for special purposes in some encodings.

If an encoding has this property, it is easy to search for occurrences of ASCII characters within strings of this encoding—you do not need to keep track whether a byte in the range 0x20–7F really represents an ASCII character or rather is part of some multi-byte character.

The guarantees when mapping between Unicode and a given encoding with the ASCII property are as follows: When mapping from Unicode to the given encoding, U+0020–007F map to 0x20–7F (but there can also be other Unicode characters mapping into the range 0x20–7F), and when mapping from the given encoding to Unicode, 0x20–7F map to U+0020–007F (again, there can also be other characters mapping into the range U+0020–007F). In particular, this ensures round-trip conversion for the ASCII range.

In principle, the ASCII property is orthogonal to the CONTEXT property. In practice, however, an encoding that has the ASCII property will most likely not also have the CONTEXT property.

RTL_TEXTENCODING_INFO_UNICODE: The encoding is based on the Unicode character repertoire.

RTL_TEXTENCODING_INFO_MULTIBYTE: A multi-byte encoding.

RTL_TEXTENCODING_INFO_R2L: An encoding used mainly or exclusively for languages written from right to left.

RTL_TEXTENCODING_INFO_7BIT: A 7-bit instead of an 8-bit encoding.

RTL_TEXTENCODING_INFO_SYMBOL: A (generic) encoding for symbol character sets.

RTL_TEXTENCODING_INFO_MIME: The encoding is registered as a MIME charset.

sal_uInt8 _rtl_TextEncodingInfo::MaximumCharSize

The maximum number of bytes needed to encode any character in the given encoding.

Can be rather meaningless for encodings that encode global state along with the characters (e.g., ISO-2022 encodings).

sal_uInt8 _rtl_TextEncodingInfo::MinimumCharSize

The minimum number of bytes needed to encode any character in the given encoding.

Can be rather meaningless for encodings that encode global state along with the characters (e.g., ISO-2022 encodings).

sal_uInt8 _rtl_TextEncodingInfo::Reserved

An unused byte, for padding.

sal_uInt32 _rtl_TextEncodingInfo::StructSize

The size (in bytes) of this structure.

Should be 12.

The documentation for this struct was generated from the following file:

- rtl/tencinfo.h