LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Typedefs | Functions
tencinfo.h File Reference
#include <sal/config.h>
#include <rtl/textenc.h>
#include <sal/saldllapi.h>
#include <sal/types.h>

Go to the source code of this file.

Classes

struct  _rtl_TextEncodingInfo
 Information about a text encoding. More...
 

Macros

#define RTL_TEXTENCODING_INFO_CONTEXT   ((sal_uInt32)0x00000001)
 
#define RTL_TEXTENCODING_INFO_ASCII   ((sal_uInt32)0x00000002)
 
#define RTL_TEXTENCODING_INFO_UNICODE   ((sal_uInt32)0x00000004)
 
#define RTL_TEXTENCODING_INFO_MULTIBYTE   ((sal_uInt32)0x00000008)
 
#define RTL_TEXTENCODING_INFO_R2L   ((sal_uInt32)0x00000010)
 
#define RTL_TEXTENCODING_INFO_7BIT   ((sal_uInt32)0x00000020)
 
#define RTL_TEXTENCODING_INFO_SYMBOL   ((sal_uInt32)0x00000040)
 
#define RTL_TEXTENCODING_INFO_MIME   ((sal_uInt32)0x00000080)
 

Typedefs

typedef struct
_rtl_TextEncodingInfo 
rtl_TextEncodingInfo
 Information about a text encoding. More...
 

Functions

SAL_DLLPUBLIC sal_Bool rtl_isOctetTextEncoding (rtl_TextEncoding nEncoding)
 Determine whether a text encoding uses single octets as basic units of information (and can thus be used with the conversion routines in rtl/textcvt.h). More...
 
SAL_DLLPUBLIC sal_Bool rtl_getTextEncodingInfo (rtl_TextEncoding eTextEncoding, rtl_TextEncodingInfo *pEncInfo)
 Return information about a text encoding. More...
 
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromWindowsCharset (sal_uInt8 nWinCharset)
 Map from a numeric Windows charset to a text encoding. More...
 
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromMimeCharset (const sal_Char *pMimeCharset)
 Map from a MIME charset to a text encoding. More...
 
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromUnixCharset (const sal_Char *pUnixCharset)
 Map from a Unix charset to a text encoding. More...
 
SAL_DLLPUBLIC sal_uInt8 rtl_getBestWindowsCharsetFromTextEncoding (rtl_TextEncoding eTextEncoding)
 Map from a text encoding to the best matching numeric Windows charset. More...
 
SAL_DLLPUBLIC char const * rtl_getMimeCharsetFromTextEncoding (rtl_TextEncoding nEncoding)
 Map from a text encoding to a corresponding MIME charset name, if available (see http://www.iana.org/assignments/character-sets). More...
 
SAL_DLLPUBLIC const sal_Charrtl_getBestMimeCharsetFromTextEncoding (rtl_TextEncoding eTextEncoding)
 Map from a text encoding to the best matching MIME charset. More...
 
SAL_DLLPUBLIC const sal_Charrtl_getBestUnixCharsetFromTextEncoding (rtl_TextEncoding eTextEncoding)
 Map from a text encoding to the best matching Unix charset. More...
 
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromWindowsCodePage (sal_uInt32 nCodePage)
 Map from a Windows code page to a text encoding. More...
 
SAL_DLLPUBLIC sal_uInt32 rtl_getWindowsCodePageFromTextEncoding (rtl_TextEncoding nEncoding)
 Map from a text encoding to a Windows code page. More...
 

Macro Definition Documentation

#define RTL_TEXTENCODING_INFO_7BIT   ((sal_uInt32)0x00000020)
#define RTL_TEXTENCODING_INFO_ASCII   ((sal_uInt32)0x00000002)
#define RTL_TEXTENCODING_INFO_CONTEXT   ((sal_uInt32)0x00000001)
#define RTL_TEXTENCODING_INFO_MIME   ((sal_uInt32)0x00000080)
#define RTL_TEXTENCODING_INFO_MULTIBYTE   ((sal_uInt32)0x00000008)
#define RTL_TEXTENCODING_INFO_R2L   ((sal_uInt32)0x00000010)
#define RTL_TEXTENCODING_INFO_SYMBOL   ((sal_uInt32)0x00000040)
#define RTL_TEXTENCODING_INFO_UNICODE   ((sal_uInt32)0x00000004)

Typedef Documentation

Information about a text encoding.

Function Documentation

SAL_DLLPUBLIC const sal_Char* rtl_getBestMimeCharsetFromTextEncoding ( rtl_TextEncoding  eTextEncoding)

Map from a text encoding to the best matching MIME charset.

Parameters
eTextEncodingAny rtl_TextEncoding value.
Returns
The best matching MIME charset string, or null if none matches.
SAL_DLLPUBLIC const sal_Char* rtl_getBestUnixCharsetFromTextEncoding ( rtl_TextEncoding  eTextEncoding)

Map from a text encoding to the best matching Unix charset.

Parameters
eTextEncodingAny rtl_TextEncoding value.
Returns
The best matching Unix charset string, or null if none matches.
SAL_DLLPUBLIC sal_uInt8 rtl_getBestWindowsCharsetFromTextEncoding ( rtl_TextEncoding  eTextEncoding)

Map from a text encoding to the best matching numeric Windows charset.

Parameters
eTextEncodingAny rtl_TextEncoding value.
Returns
The best matching numeric Windows charset, or 1 if none matches.
SAL_DLLPUBLIC char const* rtl_getMimeCharsetFromTextEncoding ( rtl_TextEncoding  nEncoding)

Map from a text encoding to a corresponding MIME charset name, if available (see http://www.iana.org/assignments/character-sets).

Parameters
nEncodingAny rtl_TextEncoding value.
Returns
The (preferred) MIME charset name corresponding to the given encoding, or NULL if none is available.
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromMimeCharset ( const sal_Char pMimeCharset)

Map from a MIME charset to a text encoding.

Parameters
pMimeCharsetAny MIME charset string. Must not be null.
Returns
The corresponding rtl_TextEncoding value, or RTL_TEXTENCODING_DONTKNOW if no mapping is applicable.
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromUnixCharset ( const sal_Char pUnixCharset)

Map from a Unix charset to a text encoding.

Parameters
pUnixCharsetAny Unix charset string. Must not be null.
Returns
The corresponding rtl_TextEncoding value, or RTL_TEXTENCODING_DONTKNOW if no mapping is applicable.
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromWindowsCharset ( sal_uInt8  nWinCharset)

Map from a numeric Windows charset to a text encoding.

Parameters
nWinCharsetAny numeric Windows charset.
Returns
The corresponding rtl_TextEncoding value, or RTL_TEXTENCODING_DONTKNOW if no mapping is applicable. If nWinCharset is 255 (OEM_CHARSET), then return value is RTL_TEXTENCODING_IBM_850, regardless of current locale.
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromWindowsCodePage ( sal_uInt32  nCodePage)

Map from a Windows code page to a text encoding.

Parameters
nCodePageAny Windows code page number.
Returns
The corresponding rtl_TextEncoding value (which will be an octet text encoding, see rtl_isOctetTextEncoding), or RTL_TEXTENCODING_DONTKNOW if no mapping is applicable.
SAL_DLLPUBLIC sal_Bool rtl_getTextEncodingInfo ( rtl_TextEncoding  eTextEncoding,
rtl_TextEncodingInfo pEncInfo 
)

Return information about a text encoding.

Parameters
eTextEncodingAny rtl_TextEncoding value.
pEncInfoReturns information about the given encoding. Must not be null, and the StructSize member must be set correctly.
Returns
True if information about the given encoding is available, false otherwise.
SAL_DLLPUBLIC sal_uInt32 rtl_getWindowsCodePageFromTextEncoding ( rtl_TextEncoding  nEncoding)

Map from a text encoding to a Windows code page.

Parameters
nEncodingAny rtl_TextEncoding value.
Returns
The corresponding Windows code page number, or 0 if no mapping is applicable.
SAL_DLLPUBLIC sal_Bool rtl_isOctetTextEncoding ( rtl_TextEncoding  nEncoding)

Determine whether a text encoding uses single octets as basic units of information (and can thus be used with the conversion routines in rtl/textcvt.h).

Parameters
nEncodingAny rtl_TextEncoding value.
Returns
True if the given encoding uses single octets as basic units of information, false otherwise.