DCL 4.0
Loading...
Searching...
No Matches
Charset.h File Reference
#include <dcl/Config.h>
#include <bits/types/mbstate_t.h>
#include <dcl/Object.h>
#include <dcl/Exception.h>
#include <dcl/String.h>

Go to the source code of this file.

Classes

class  CharsetConvertException
class  CharsetEncoder
class  CharsetDecoder
class  UTF8Encoder
class  UTF8Decoder
class  UTF16Encoder
class  UTF16Decoder
class  UTF32Encoder
class  UTF32Decoder
class  AsciiEncoder
class  AsciiDecoder
class  Latin1Encoder
class  Latin1Decoder
class  LocaleEncoder
class  LocaleDecoder

Macros

#define __DCL_CHARSET_H__   20071008
#define IS_UTF8(bom)
#define IS_UTF16BE(bom)
#define IS_UTF16LE(bom)
#define IS_UTF16(bom)
#define IS_UTF32BE(bom)
#define IS_UTF32LE(bom)
#define IS_UTF32(bom)

Typedefs

typedef uint16_t utf16_t
typedef uint32_t utf32_t

Enumerations

enum  Charset {
  CS_LOCALE = (int)0 , CS_ASCII , CS_LATIN1 , CS_UTF8 ,
  CS_UTF16 , CS_UTF32
}
enum  UnicodeByteOrder { CS_DEFAULT_ENDIAN = __BYTE_ORDER , CS_LITTLE_ENDIAN = __LITTLE_ENDIAN , CS_BIG_ENDIAN = __BIG_ENDIAN }
enum  {
  CS_NOERROR = 0 , CS_ILLEGAL_UCS , CS_SOURCE_FEW , CS_ILLEGAL_SEQUENCE ,
  CS_ILLEGAL_UCS2
}

Variables

__DCL_BEGIN_NAMESPACE typedef uint32_t ucs4_t

Macro Definition Documentation

◆ __DCL_CHARSET_H__

#define __DCL_CHARSET_H__   20071008

Definition at line 2 of file Charset.h.

◆ IS_UTF16

#define IS_UTF16 ( bom)
Value:
(IS_UTF16BE(bom) || IS_UTF16LE(bom))
#define IS_UTF16LE(bom)
Definition Charset.h:35
#define IS_UTF16BE(bom)
Definition Charset.h:34

Definition at line 36 of file Charset.h.

◆ IS_UTF16BE

#define IS_UTF16BE ( bom)
Value:
((bom[0] == 0xFE) && (bom[1] == 0xFF))

Definition at line 34 of file Charset.h.

◆ IS_UTF16LE

#define IS_UTF16LE ( bom)
Value:
((bom[0] == 0xFF) && (bom[1] == 0xFE))

Definition at line 35 of file Charset.h.

◆ IS_UTF32

#define IS_UTF32 ( bom)
Value:
(IS_UTF32BE(bom) || IS_UTF32LE(bom))
#define IS_UTF32BE(bom)
Definition Charset.h:37
#define IS_UTF32LE(bom)
Definition Charset.h:39

Definition at line 41 of file Charset.h.

◆ IS_UTF32BE

#define IS_UTF32BE ( bom)
Value:
((bom[0] == 0x00) && (bom[1] == 0x00) \
&& (bom[2] == 0xFE) && (bom[3] == 0xFF))

Definition at line 37 of file Charset.h.

37#define IS_UTF32BE(bom) ((bom[0] == 0x00) && (bom[1] == 0x00) \
38 && (bom[2] == 0xFE) && (bom[3] == 0xFF))

◆ IS_UTF32LE

#define IS_UTF32LE ( bom)
Value:
((bom[0] == 0xFF) && (bom[1] == 0xFE) \
&& (bom[2] == 0x00) && (bom[3] == 0x00))

Definition at line 39 of file Charset.h.

39#define IS_UTF32LE(bom) ((bom[0] == 0xFF) && (bom[1] == 0xFE) \
40 && (bom[2] == 0x00) && (bom[3] == 0x00))

◆ IS_UTF8

#define IS_UTF8 ( bom)
Value:
((bom[0] == 0xEF) && (bom[1] == 0xBB) && (bom[2] == 0xBF))

Definition at line 33 of file Charset.h.

Typedef Documentation

◆ utf16_t

typedef uint16_t utf16_t

Definition at line 30 of file Charset.h.

◆ utf32_t

typedef uint32_t utf32_t

Definition at line 31 of file Charset.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CS_NOERROR 
CS_ILLEGAL_UCS 
CS_SOURCE_FEW 
CS_ILLEGAL_SEQUENCE 
CS_ILLEGAL_UCS2 

Definition at line 60 of file Charset.h.

60 {
61 CS_NOERROR = 0,
62 // encode()
63 CS_ILLEGAL_UCS, // can't UCS4 ==> MB
64 // decode()
65 CS_SOURCE_FEW, // source bytes few
66 CS_ILLEGAL_SEQUENCE, // illegal bytes sequence
67 CS_ILLEGAL_UCS2 // can't UCS4 ==> UCS2 , on sizeof(wchar_t) == 2
68};
@ CS_SOURCE_FEW
Definition Charset.h:65
@ CS_NOERROR
Definition Charset.h:61
@ CS_ILLEGAL_UCS
Definition Charset.h:63
@ CS_ILLEGAL_UCS2
Definition Charset.h:67
@ CS_ILLEGAL_SEQUENCE
Definition Charset.h:66

◆ Charset

enum Charset
Enumerator
CS_LOCALE 
CS_ASCII 
CS_LATIN1 
CS_UTF8 
CS_UTF16 
CS_UTF32 

Definition at line 43 of file Charset.h.

44{
45 CS_LOCALE = (int)0,
46 CS_ASCII, // 7bit, US_ASCII
47 CS_LATIN1, // 8bit, ISO-8859-1
48 CS_UTF8, // http://www.faqs.org/rfcs/rfc3629.html
51};
@ CS_UTF8
Definition Charset.h:48
@ CS_LATIN1
Definition Charset.h:47
@ CS_UTF32
Definition Charset.h:50
@ CS_UTF16
Definition Charset.h:49
@ CS_ASCII
Definition Charset.h:46
@ CS_LOCALE
Definition Charset.h:45

◆ UnicodeByteOrder

Enumerator
CS_DEFAULT_ENDIAN 
CS_LITTLE_ENDIAN 
CS_BIG_ENDIAN 

Definition at line 53 of file Charset.h.

53 {
54 // UTF16, UTF32
55 CS_DEFAULT_ENDIAN = __BYTE_ORDER, // platform dependent default
58};
@ CS_DEFAULT_ENDIAN
Definition Charset.h:55
@ CS_BIG_ENDIAN
Definition Charset.h:57
@ CS_LITTLE_ENDIAN
Definition Charset.h:56
#define __BIG_ENDIAN
Definition Config.h:242
#define __LITTLE_ENDIAN
Definition Config.h:241

Variable Documentation

◆ ucs4_t

__DCL_BEGIN_NAMESPACE typedef uint32_t ucs4_t

Definition at line 29 of file Charset.h.