# code conversion library

## マクロ定義
#define | CCC_CP000 0x00
#define | CCC_CP437 0x01
#define | CCC_CP850 0x05
#define | CCC_CP866 0x0b
#define | CCC_CP932 0x0d
#define | CCC_CP936 0x0e
#define | CCC_CP949 0x0f
#define | CCC_CP950 0x10
#define | CCC_CP1251 0x12
#define | CCC_CP1252 0x13
#define | CCC_CPUTF8 0xff
#define | CCC_N_CP 0x14
#define | CCC_SUCCESS 0x00000000
#define | CCC_ERROR_BUFFER_SIZE 0x80000104
#define | CCC_ERROR_INPUT_STREAM 0x80000108
#define | CCC_ERROR_MEM_ALLOC 0x800200D9
#define | CCC_ERROR_FILE_READ 0x80020130
#define | CCC_ERROR_UNSUPPORTED 0x80020325
## 型定義
typedef unsigned short | cccUCS2
typedef unsigned char | cccCode
## 関数
int | cccStrlenSJIS (cccCode const *str)
| Character counting.
int | cccStrlenGBK (cccCode const *str)
int | cccStrlenKOR (cccCode const *str)
int | cccStrlenBIG5 (cccCode const *str)
int | cccStrlenUTF8 (cccCode const *str)
int | cccStrlenCode (cccCode const *str, unsigned char cp)
int | cccStrlenUCS2 (cccUCS2 const *str)
int | cccSJIStoUCS2 (cccUCS2 *dst, size_t count, cccCode const *str)
| Character code conversion.
int | cccGBKtoUCS2 (cccUCS2 *dst, size_t count, cccCode const *str)
int | cccKORtoUCS2 (cccUCS2 *dst, size_t count, cccCode const *str)
int | cccBIG5toUCS2 (cccUCS2 *dst, size_t count, cccCode const *str)
int | cccUTF8toUCS2 (cccUCS2 *dst, size_t count, cccCode const *str)
cccUCS2 | cccSetErrorCharUCS2 (cccUCS2 code)
| Set error character (character that's used for code points where conversion failed).
void | cccShutDown (void)
| Shutdown the Character Code Conversion Library.

## マクロ定義

#define CCC_CP000 0x00

#define CCC_CP1251 0x12

#define CCC_CP1252 0x13

#define CCC_CP437 0x01

#define CCC_CP850 0x05

#define CCC_CP866 0x0b

#define CCC_CP932 0x0d

#define CCC_CP936 0x0e

#define CCC_CP949 0x0f

#define CCC_CP950 0x10

#define CCC_CPUTF8 0xff

#define CCC_ERROR_BUFFER_SIZE 0x80000104

#define CCC_ERROR_FILE_READ 0x80020130

#define CCC_ERROR_INPUT_STREAM 0x80000108

#define CCC_ERROR_MEM_ALLOC 0x800200D9

#define CCC_ERROR_UNSUPPORTED 0x80020325

#define CCC_N_CP 0x14

#define CCC_SUCCESS 0x00000000

## 型定義

typedef unsigned char cccCode

typedef unsigned short cccUCS2

## 関数

int cccBIG5toUCS2 | ( | cccUCS2 * | dst,
|  | size_t | count,
|  | cccCode const * | str |
| ) |  |  |

int cccGBKtoUCS2 | ( | cccUCS2 * | dst,
|  | size_t | count,
|  | cccCode const * | str |
| ) |  |  |

int cccKORtoUCS2 | ( | cccUCS2 * | dst,
|  | size_t | count,
|  | cccCode const * | str |
| ) |  |  |

cccUCS2 cccSetErrorCharUCS2 | ( | cccUCS2 | code | ) |

Set error character (character that's used for code points where conversion failed).

引数:

  | code | - new error character (default: 0)

戻り値:
  previous error character

void cccShutDown | ( | void |  | ) |

Shutdown the Character Code Conversion Library.

int cccSJIStoUCS2 | ( | cccUCS2 * | dst,
|  | size_t | count,
|  | cccCode const * | str |
| ) |  |  |

Character code conversion.

引数:

  | dst | - output string
  | count | - size of output buffer
  | str | - input string
  | cp | - codepage

戻り値:
  number of converted character codes

int cccStrlenBIG5 | ( | cccCode const * | str | ) |

int cccStrlenCode | ( | cccCode const * | str,
|  | unsigned char | cp |
| ) |  |  |

int cccStrlenGBK | ( | cccCode const * | str | ) |

int cccStrlenKOR | ( | cccCode const * | str | ) |

int cccStrlenSJIS | ( | cccCode const * | str | ) |

Character counting.

引数:

  | str | - zero terminated string
  | cp | - codepage

戻り値:
  number of characters in the string

int cccStrlenUCS2 | ( | cccUCS2 const * | str | ) |

int cccStrlenUTF8 | ( | cccCode const * | str | ) |

int cccUTF8toUCS2 | ( | cccUCS2 * | dst,
|  | size_t | count,
|  | cccCode const * | str |
| ) |  |  |