LibreOffice LibreOffice 25.8 SDK C/C++ API Reference

Loading...
Searching...
No Matches
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.

## 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).
SAL_DLLPUBLIC sal_Bool | rtl_getTextEncodingInfo (rtl_TextEncoding eTextEncoding, rtl_TextEncodingInfo *pEncInfo)
| Return information about a text encoding.
SAL_DLLPUBLIC rtl_TextEncoding | rtl_getTextEncodingFromWindowsCharset (sal_uInt8 nWinCharset)
| Map from a numeric Windows charset to a text encoding.
SAL_DLLPUBLIC rtl_TextEncoding | rtl_getTextEncodingFromMimeCharset (const char *pMimeCharset)
| Map from a MIME charset to a text encoding.
SAL_DLLPUBLIC rtl_TextEncoding | rtl_getTextEncodingFromUnixCharset (const char *pUnixCharset)
| Map from a Unix charset to a text encoding.
SAL_DLLPUBLIC sal_uInt8 | rtl_getBestWindowsCharsetFromTextEncoding (rtl_TextEncoding eTextEncoding)
| Map from a text encoding to the best matching numeric Windows charset.
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).
SAL_DLLPUBLIC const char * | rtl_getBestMimeCharsetFromTextEncoding (rtl_TextEncoding eTextEncoding)
| Map from a text encoding to the best matching MIME charset.
SAL_DLLPUBLIC const char * | rtl_getBestUnixCharsetFromTextEncoding (rtl_TextEncoding eTextEncoding)
| Map from a text encoding to the best matching Unix charset.
SAL_DLLPUBLIC rtl_TextEncoding | rtl_getTextEncodingFromWindowsCodePage (sal_uInt32 nCodePage)
| Map from a Windows code page to a text encoding.
SAL_DLLPUBLIC sal_uInt32 | rtl_getWindowsCodePageFromTextEncoding (rtl_TextEncoding nEncoding)
| Map from a text encoding to a Windows code page.

## Macro Definition Documentation

## ◆ RTL_TEXTENCODING_INFO_7BIT

#define RTL_TEXTENCODING_INFO_7BIT ((sal_uInt32)0x00000020)

## ◆ RTL_TEXTENCODING_INFO_ASCII

#define RTL_TEXTENCODING_INFO_ASCII ((sal_uInt32)0x00000002)

## ◆ RTL_TEXTENCODING_INFO_CONTEXT

#define RTL_TEXTENCODING_INFO_CONTEXT ((sal_uInt32)0x00000001)

## ◆ RTL_TEXTENCODING_INFO_MIME

#define RTL_TEXTENCODING_INFO_MIME ((sal_uInt32)0x00000080)

## ◆ RTL_TEXTENCODING_INFO_MULTIBYTE

#define RTL_TEXTENCODING_INFO_MULTIBYTE ((sal_uInt32)0x00000008)

## ◆ RTL_TEXTENCODING_INFO_R2L

#define RTL_TEXTENCODING_INFO_R2L ((sal_uInt32)0x00000010)

## ◆ RTL_TEXTENCODING_INFO_SYMBOL

#define RTL_TEXTENCODING_INFO_SYMBOL ((sal_uInt32)0x00000040)

## ◆ RTL_TEXTENCODING_INFO_UNICODE

#define RTL_TEXTENCODING_INFO_UNICODE ((sal_uInt32)0x00000004)

## Typedef Documentation

## ◆ rtl_TextEncodingInfo

typedef struct _rtl_TextEncodingInfo rtl_TextEncodingInfo

Information about a text encoding.

## Function Documentation

## ◆ rtl_getBestMimeCharsetFromTextEncoding()

SAL_DLLPUBLIC const char * rtl_getBestMimeCharsetFromTextEncoding | ( | rtl_TextEncoding | eTextEncoding | ) |

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

Parameters

  eTextEncoding | Any rtl_TextEncoding value.

Returns
  The best matching MIME charset string, or null if none matches.

## ◆ rtl_getBestUnixCharsetFromTextEncoding()

SAL_DLLPUBLIC const char * rtl_getBestUnixCharsetFromTextEncoding | ( | rtl_TextEncoding | eTextEncoding | ) |

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

Parameters

  eTextEncoding | Any rtl_TextEncoding value.

Returns
  The best matching Unix charset string, or null if none matches.

## ◆ rtl_getBestWindowsCharsetFromTextEncoding()

SAL_DLLPUBLIC sal_uInt8 rtl_getBestWindowsCharsetFromTextEncoding | ( | rtl_TextEncoding | eTextEncoding | ) |

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

Parameters

  eTextEncoding | Any rtl_TextEncoding value.

Returns
  The best matching numeric Windows charset, or 1 if none matches.

## ◆ rtl_getMimeCharsetFromTextEncoding()

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

  nEncoding | Any rtl_TextEncoding value.

Returns
  The (preferred) MIME charset name corresponding to the given encoding, or NULL if none is available.

## ◆ rtl_getTextEncodingFromMimeCharset()

SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromMimeCharset | ( | const char * | pMimeCharset | ) |

Map from a MIME charset to a text encoding.

Parameters

  pMimeCharset | Any MIME charset string. Must not be null.

Returns
  The corresponding rtl_TextEncoding value, or RTL_TEXTENCODING_DONTKNOW if no mapping is applicable.

## ◆ rtl_getTextEncodingFromUnixCharset()

SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromUnixCharset | ( | const char * | pUnixCharset | ) |

Map from a Unix charset to a text encoding.

Parameters

  pUnixCharset | Any Unix charset string. Must not be null.

Returns
  The corresponding rtl_TextEncoding value, or RTL_TEXTENCODING_DONTKNOW if no mapping is applicable.

## ◆ rtl_getTextEncodingFromWindowsCharset()

SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromWindowsCharset | ( | sal_uInt8 | nWinCharset | ) |

Map from a numeric Windows charset to a text encoding.

Parameters

  nWinCharset | Any 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.

## ◆ rtl_getTextEncodingFromWindowsCodePage()

SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromWindowsCodePage | ( | sal_uInt32 | nCodePage | ) |

Map from a Windows code page to a text encoding.

Parameters

  nCodePage | Any 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.

## ◆ rtl_getTextEncodingInfo()

SAL_DLLPUBLIC sal_Bool rtl_getTextEncodingInfo | ( | rtl_TextEncoding | eTextEncoding,
|  | rtl_TextEncodingInfo * | pEncInfo )

Return information about a text encoding.

Parameters

  eTextEncoding | Any rtl_TextEncoding value.
  pEncInfo | Returns 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.

## ◆ rtl_getWindowsCodePageFromTextEncoding()

SAL_DLLPUBLIC sal_uInt32 rtl_getWindowsCodePageFromTextEncoding | ( | rtl_TextEncoding | nEncoding | ) |

Map from a text encoding to a Windows code page.

Parameters

  nEncoding | Any rtl_TextEncoding value.

Returns
  The corresponding Windows code page number, or 0 if no mapping is applicable.

## ◆ rtl_isOctetTextEncoding()

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

  nEncoding | Any rtl_TextEncoding value.

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