utf_16_32.c File Reference
`#include "transcode_data.h"`

Go to the source code of this file.

## Macros

#define | from_UTF_16LE_00toFF_D8toDB_00toFF_offsets 0
#define | from_UTF_16LE_00toFF_D8toDB_offsets 6
#define | from_UTF_16LE_00toFF_offsets 264
#define | from_UTF_32LE_00toFF_00toD7_00_offsets 522
#define | from_UTF_32LE_00toFF_00toD7_offsets 525
#define | from_UTF_32LE_00toFF_D8toDF_offsets 544
#define | from_UTF_32LE_00toFF_offsets 562
#define | from_UTF_32BE_00_offsets 820
#define | from_UTF_8_C2toDF_offsets 839
#define | from_UTF_8_E0_offsets 905
#define | from_UTF_8_ED_offsets 939
#define | from_UTF_8_F0_offsets 973
#define | from_UTF_8_F4_offsets 1023
#define | from_UTF_8_offsets 1041
#define | from_UTF_16LE_00toFF_D8toDB_00toFF_infos WORDINDEX2INFO(0)
#define | from_UTF_16LE_00toFF_D8toDB_00toFF WORDINDEX2INFO(2)
#define | from_UTF_16LE_00toFF_D8toDB_infos WORDINDEX2INFO(4)
#define | from_UTF_16LE_00toFF_D8toDB WORDINDEX2INFO(5)
#define | from_UTF_16LE_00toFF_infos WORDINDEX2INFO(7)
#define | from_UTF_16LE_00toFF WORDINDEX2INFO(10)
#define | from_UTF_16LE_infos WORDINDEX2INFO(12)
#define | from_UTF_16LE WORDINDEX2INFO(13)
#define | from_UTF_32LE_00toFF_00toD7_00_infos WORDINDEX2INFO(15)
#define | from_UTF_32LE_00toFF_00toD7_00 WORDINDEX2INFO(17)
#define | from_UTF_32LE_00toFF_00toD7_infos WORDINDEX2INFO(19)
#define | from_UTF_32LE_00toFF_00toD7 WORDINDEX2INFO(21)
#define | from_UTF_32LE_00toFF_D8toDF_infos WORDINDEX2INFO(23)
#define | from_UTF_32LE_00toFF_D8toDF WORDINDEX2INFO(25)
#define | from_UTF_32LE_00toFF_infos WORDINDEX2INFO(27)
#define | from_UTF_32LE_00toFF WORDINDEX2INFO(29)
#define | from_UTF_32LE_infos WORDINDEX2INFO(31)
#define | from_UTF_32LE WORDINDEX2INFO(32)
#define | from_UTF_16BE_00toD7_infos WORDINDEX2INFO(34)
#define | from_UTF_16BE_00toD7 WORDINDEX2INFO(35)
#define | from_UTF_16BE_D8toDB_00toFF_infos WORDINDEX2INFO(37)
#define | from_UTF_16BE_D8toDB_00toFF WORDINDEX2INFO(39)
#define | from_UTF_16BE_D8toDB_infos WORDINDEX2INFO(41)
#define | from_UTF_16BE_D8toDB WORDINDEX2INFO(42)
#define | from_UTF_16BE_infos WORDINDEX2INFO(44)
#define | from_UTF_16BE WORDINDEX2INFO(47)
#define | from_UTF_32BE_00_00_infos WORDINDEX2INFO(49)
#define | from_UTF_32BE_00_00 WORDINDEX2INFO(51)
#define | from_UTF_32BE_00_01to10_infos WORDINDEX2INFO(53)
#define | from_UTF_32BE_00_01to10 WORDINDEX2INFO(54)
#define | from_UTF_32BE_00_infos WORDINDEX2INFO(56)
#define | from_UTF_32BE_00 WORDINDEX2INFO(59)
#define | from_UTF_32BE_infos WORDINDEX2INFO(61)
#define | from_UTF_32BE WORDINDEX2INFO(63)
#define | from_UTF_16_00toFF_infos WORDINDEX2INFO(65)
#define | from_UTF_16_00toFF WORDINDEX2INFO(66)
#define | from_UTF_16_infos WORDINDEX2INFO(68)
#define | from_UTF_16 WORDINDEX2INFO(69)
#define | from_UTF_32_00toFF_infos WORDINDEX2INFO(71)
#define | from_UTF_32_00toFF WORDINDEX2INFO(72)
#define | from_UTF_32_infos WORDINDEX2INFO(74)
#define | from_UTF_32 WORDINDEX2INFO(75)
#define | from_UTF_8_C2toDF WORDINDEX2INFO(77)
#define | from_UTF_8_E0_infos WORDINDEX2INFO(79)
#define | from_UTF_8_E0 WORDINDEX2INFO(81)
#define | from_UTF_8_E1toEC WORDINDEX2INFO(83)
#define | from_UTF_8_ED WORDINDEX2INFO(85)
#define | from_UTF_8_F0_infos WORDINDEX2INFO(87)
#define | from_UTF_8_F0 WORDINDEX2INFO(89)
#define | from_UTF_8_F1toF3 WORDINDEX2INFO(91)
#define | from_UTF_8_F4 WORDINDEX2INFO(93)
#define | from_UTF_8_infos WORDINDEX2INFO(95)
#define | from_UTF_8 WORDINDEX2INFO(104)
#define | TRANSCODE_TABLE_INFO utf_16_32_byte_array, 1288, utf_16_32_word_array, 106, ((int)sizeof(unsigned int))
#define | BE 1
#define | LE 2

## Functions

static ssize_t | fun_so_from_utf_16be (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | fun_so_to_utf_16be (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | fun_so_from_utf_16le (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | fun_so_to_utf_16le (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | fun_so_from_utf_32be (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | fun_so_to_utf_32be (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | fun_so_from_utf_32le (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | fun_so_to_utf_32le (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static int | state_init (void *statep)
static VALUE | fun_si_from_utf_16 (void *statep, const unsigned char *s, size_t l)
static ssize_t | fun_so_from_utf_16 (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static VALUE | fun_si_from_utf_32 (void *statep, const unsigned char *s, size_t l)
static ssize_t | fun_so_from_utf_32 (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | fun_so_to_utf_16 (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | fun_so_to_utf_32 (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
void | Init_utf_16_32 (void)

## Variables

static const unsigned char | utf_16_32_byte_array [1288]
static const unsigned int | utf_16_32_word_array [106]
static const rb_transcoder | rb_from_UTF_16BE
static const rb_transcoder | rb_to_UTF_16BE
static const rb_transcoder | rb_from_UTF_16LE
static const rb_transcoder | rb_to_UTF_16LE
static const rb_transcoder | rb_from_UTF_32BE
static const rb_transcoder | rb_to_UTF_32BE
static const rb_transcoder | rb_from_UTF_32LE
static const rb_transcoder | rb_to_UTF_32LE
static const rb_transcoder | rb_from_UTF_16
static const rb_transcoder | rb_from_UTF_32
static const rb_transcoder | rb_to_UTF_16
static const rb_transcoder | rb_to_UTF_32

## Macro Definition Documentation

#define BE 1

Referenced by fun_si_from_utf_16(), fun_si_from_utf_32(), fun_so_from_utf_16(), and fun_so_from_utf_32().

#define from_UTF_16 WORDINDEX2INFO(69)

#define from_UTF_16_00toFF WORDINDEX2INFO(66)

#define from_UTF_16_00toFF_infos WORDINDEX2INFO(65)

#define from_UTF_16_infos WORDINDEX2INFO(68)

#define from_UTF_16BE WORDINDEX2INFO(47)

#define from_UTF_16BE_00toD7 WORDINDEX2INFO(35)

#define from_UTF_16BE_00toD7_infos WORDINDEX2INFO(34)

#define from_UTF_16BE_D8toDB WORDINDEX2INFO(42)

#define from_UTF_16BE_D8toDB_00toFF WORDINDEX2INFO(39)

Referenced by fun_si_from_utf_16().

#define from_UTF_16BE_D8toDB_00toFF_infos WORDINDEX2INFO(37)

#define from_UTF_16BE_D8toDB_infos WORDINDEX2INFO(41)

#define from_UTF_16BE_infos WORDINDEX2INFO(44)

#define from_UTF_16LE WORDINDEX2INFO(13)

#define from_UTF_16LE_00toFF WORDINDEX2INFO(10)

#define from_UTF_16LE_00toFF_D8toDB WORDINDEX2INFO(5)

Referenced by fun_si_from_utf_16().

#define from_UTF_16LE_00toFF_D8toDB_00toFF WORDINDEX2INFO(2)

#define from_UTF_16LE_00toFF_D8toDB_00toFF_infos WORDINDEX2INFO(0)

#define from_UTF_16LE_00toFF_D8toDB_00toFF_offsets 0

#define from_UTF_16LE_00toFF_D8toDB_infos WORDINDEX2INFO(4)

#define from_UTF_16LE_00toFF_D8toDB_offsets 6

#define from_UTF_16LE_00toFF_infos WORDINDEX2INFO(7)

#define from_UTF_16LE_00toFF_offsets 264

#define from_UTF_16LE_infos WORDINDEX2INFO(12)

#define from_UTF_32 WORDINDEX2INFO(75)

#define from_UTF_32_00toFF WORDINDEX2INFO(72)

#define from_UTF_32_00toFF_infos WORDINDEX2INFO(71)

#define from_UTF_32_infos WORDINDEX2INFO(74)

#define from_UTF_32BE WORDINDEX2INFO(63)

#define from_UTF_32BE_00 WORDINDEX2INFO(59)

#define from_UTF_32BE_00_00 WORDINDEX2INFO(51)

#define from_UTF_32BE_00_00_infos WORDINDEX2INFO(49)

#define from_UTF_32BE_00_01to10 WORDINDEX2INFO(54)

#define from_UTF_32BE_00_01to10_infos WORDINDEX2INFO(53)

#define from_UTF_32BE_00_infos WORDINDEX2INFO(56)

#define from_UTF_32BE_00_offsets 820

#define from_UTF_32BE_infos WORDINDEX2INFO(61)

#define from_UTF_32LE WORDINDEX2INFO(32)

#define from_UTF_32LE_00toFF WORDINDEX2INFO(29)

#define from_UTF_32LE_00toFF_00toD7 WORDINDEX2INFO(21)

#define from_UTF_32LE_00toFF_00toD7_00 WORDINDEX2INFO(17)

#define from_UTF_32LE_00toFF_00toD7_00_infos WORDINDEX2INFO(15)

#define from_UTF_32LE_00toFF_00toD7_00_offsets 522

#define from_UTF_32LE_00toFF_00toD7_infos WORDINDEX2INFO(19)

#define from_UTF_32LE_00toFF_00toD7_offsets 525

#define from_UTF_32LE_00toFF_D8toDF WORDINDEX2INFO(25)

#define from_UTF_32LE_00toFF_D8toDF_infos WORDINDEX2INFO(23)

#define from_UTF_32LE_00toFF_D8toDF_offsets 544

#define from_UTF_32LE_00toFF_infos WORDINDEX2INFO(27)

#define from_UTF_32LE_00toFF_offsets 562

#define from_UTF_32LE_infos WORDINDEX2INFO(31)

#define from_UTF_8 WORDINDEX2INFO(104)

#define from_UTF_8_C2toDF WORDINDEX2INFO(77)

#define from_UTF_8_C2toDF_offsets 839

#define from_UTF_8_E0 WORDINDEX2INFO(81)

#define from_UTF_8_E0_infos WORDINDEX2INFO(79)

#define from_UTF_8_E0_offsets 905

#define from_UTF_8_E1toEC WORDINDEX2INFO(83)

#define from_UTF_8_ED WORDINDEX2INFO(85)

#define from_UTF_8_ED_offsets 939

#define from_UTF_8_F0 WORDINDEX2INFO(89)

#define from_UTF_8_F0_infos WORDINDEX2INFO(87)

#define from_UTF_8_F0_offsets 973

#define from_UTF_8_F1toF3 WORDINDEX2INFO(91)

#define from_UTF_8_F4 WORDINDEX2INFO(93)

#define from_UTF_8_F4_offsets 1023

#define from_UTF_8_infos WORDINDEX2INFO(95)

#define from_UTF_8_offsets 1041

#define LE 2

Referenced by fun_si_from_utf_16(), fun_si_from_utf_32(), fun_so_from_utf_16(), fun_so_from_utf_32(), and vm_init_redefined_flag().

#define TRANSCODE_TABLE_INFO utf_16_32_byte_array, 1288, utf_16_32_word_array, 106, ((int)sizeof(unsigned int))

Definition at line 335 of file utf_16_32.c.

## Function Documentation

static VALUE fun_si_from_utf_16 | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l
| ) |  |

static

Definition at line 569 of file utf_16_32.c.

References BE, from_UTF_16BE_D8toDB_00toFF, from_UTF_16LE_00toFF_D8toDB, FUNso, INVALID, LE, and ZERObt.

static VALUE fun_si_from_utf_32 | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l
| ) |  |

static

Definition at line 619 of file utf_16_32.c.

References BE, FUNso, INVALID, LE, and ZERObt.

static ssize_t fun_so_from_utf_16 | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |

static

Definition at line 606 of file utf_16_32.c.

References BE, fun_so_from_utf_16be(), fun_so_from_utf_16le(), and LE.

static ssize_t fun_so_from_utf_16be | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |

static

Definition at line 339 of file utf_16_32.c.

Referenced by fun_so_from_utf_16().

static ssize_t fun_so_from_utf_16le | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |

static

Definition at line 395 of file utf_16_32.c.

Referenced by fun_so_from_utf_16().

static ssize_t fun_so_from_utf_32 | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |

static

Definition at line 648 of file utf_16_32.c.

References BE, fun_so_from_utf_32be(), fun_so_from_utf_32le(), and LE.

static ssize_t fun_so_from_utf_32be | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |

static

Definition at line 451 of file utf_16_32.c.

Referenced by fun_so_from_utf_32().

static ssize_t fun_so_from_utf_32le | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |

static

Definition at line 506 of file utf_16_32.c.

Referenced by fun_so_from_utf_32().

static ssize_t fun_so_to_utf_16 | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |

static

Definition at line 661 of file utf_16_32.c.

References fun_so_to_utf_16be().

static ssize_t fun_so_to_utf_16be | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |

static

Definition at line 367 of file utf_16_32.c.

Referenced by fun_so_to_utf_16().

static ssize_t fun_so_to_utf_16le | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |

static

Definition at line 423 of file utf_16_32.c.

static ssize_t fun_so_to_utf_32 | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |

static

Definition at line 674 of file utf_16_32.c.

References fun_so_to_utf_32be().

static ssize_t fun_so_to_utf_32be | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |

static

Definition at line 480 of file utf_16_32.c.

Referenced by fun_so_to_utf_32().

static ssize_t fun_so_to_utf_32le | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |

static

Definition at line 535 of file utf_16_32.c.

void Init_utf_16_32 | ( | void |  | ) |

Definition at line 833 of file utf_16_32.c.

References rb_from_UTF_16, rb_from_UTF_16BE, rb_from_UTF_16LE, rb_from_UTF_32, rb_from_UTF_32BE, rb_from_UTF_32LE, rb_register_transcoder(), rb_to_UTF_16, rb_to_UTF_16BE, rb_to_UTF_16LE, rb_to_UTF_32, rb_to_UTF_32BE, and rb_to_UTF_32LE.

static int state_init | ( | void * | statep | ) |

static

Definition at line 561 of file utf_16_32.c.

## Variable Documentation

const rb_transcoder rb_from_UTF_16

static

Initial value:
= {
"UTF-16", "UTF-8", from_UTF_16,
TRANSCODE_TABLE_INFO,
2,
4,
4,
asciicompat_decoder,
1, state_init, NULL,
NULL, fun_si_from_utf_16, NULL, fun_so_from_utf_16
}

Definition at line 785 of file utf_16_32.c.

Referenced by Init_utf_16_32().

const rb_transcoder rb_from_UTF_16BE

static

Initial value:
= {
"UTF-16BE", "UTF-8", from_UTF_16BE,
TRANSCODE_TABLE_INFO,
2,
4,
4,
asciicompat_decoder,
0, NULL, NULL,
NULL, NULL, NULL, fun_so_from_utf_16be
}

Definition at line 689 of file utf_16_32.c.

Referenced by Init_utf_16_32().

const rb_transcoder rb_from_UTF_16LE

static

Initial value:
= {
"UTF-16LE", "UTF-8", from_UTF_16LE,
TRANSCODE_TABLE_INFO,
2,
4,
4,
asciicompat_decoder,
0, NULL, NULL,
NULL, NULL, NULL, fun_so_from_utf_16le
}

Definition at line 713 of file utf_16_32.c.

Referenced by Init_utf_16_32().

const rb_transcoder rb_from_UTF_32

static

Initial value:
= {
"UTF-32", "UTF-8", from_UTF_32,
TRANSCODE_TABLE_INFO,
4,
4,
4,
asciicompat_decoder,
1, state_init, NULL,
NULL, fun_si_from_utf_32, NULL, fun_so_from_utf_32
}

Definition at line 797 of file utf_16_32.c.

Referenced by Init_utf_16_32().

const rb_transcoder rb_from_UTF_32BE

static

Initial value:
= {
"UTF-32BE", "UTF-8", from_UTF_32BE,
TRANSCODE_TABLE_INFO,
4,
4,
4,
asciicompat_decoder,
0, NULL, NULL,
NULL, NULL, NULL, fun_so_from_utf_32be
}

Definition at line 737 of file utf_16_32.c.

Referenced by Init_utf_16_32().

const rb_transcoder rb_from_UTF_32LE

static

Initial value:
= {
"UTF-32LE", "UTF-8", from_UTF_32LE,
TRANSCODE_TABLE_INFO,
4,
4,
4,
asciicompat_decoder,
0, NULL, NULL,
NULL, NULL, NULL, fun_so_from_utf_32le
}

Definition at line 761 of file utf_16_32.c.

Referenced by Init_utf_16_32().

const rb_transcoder rb_to_UTF_16

static

Initial value:
= {
"UTF-8", "UTF-16", from_UTF_8,
TRANSCODE_TABLE_INFO,
1,
4,
4,
asciicompat_encoder,
1, state_init, NULL,
NULL, NULL, NULL, fun_so_to_utf_16
}

Definition at line 809 of file utf_16_32.c.

Referenced by Init_utf_16_32().

const rb_transcoder rb_to_UTF_16BE

static

Initial value:
= {
"UTF-8", "UTF-16BE", from_UTF_8,
TRANSCODE_TABLE_INFO,
1,
4,
4,
asciicompat_encoder,
0, NULL, NULL,
NULL, NULL, NULL, fun_so_to_utf_16be
}

Definition at line 701 of file utf_16_32.c.

Referenced by Init_utf_16_32().

const rb_transcoder rb_to_UTF_16LE

static

Initial value:
= {
"UTF-8", "UTF-16LE", from_UTF_8,
TRANSCODE_TABLE_INFO,
1,
4,
4,
asciicompat_encoder,
0, NULL, NULL,
NULL, NULL, NULL, fun_so_to_utf_16le
}

Definition at line 725 of file utf_16_32.c.

Referenced by Init_utf_16_32().

const rb_transcoder rb_to_UTF_32

static

Initial value:
= {
"UTF-8", "UTF-32", from_UTF_8,
TRANSCODE_TABLE_INFO,
1,
4,
4,
asciicompat_encoder,
1, state_init, NULL,
NULL, NULL, NULL, fun_so_to_utf_32
}

Definition at line 821 of file utf_16_32.c.

Referenced by Init_utf_16_32().

const rb_transcoder rb_to_UTF_32BE

static

Initial value:
= {
"UTF-8", "UTF-32BE", from_UTF_8,
TRANSCODE_TABLE_INFO,
1,
4,
4,
asciicompat_encoder,
0, NULL, NULL,
NULL, NULL, NULL, fun_so_to_utf_32be
}

Definition at line 749 of file utf_16_32.c.

Referenced by Init_utf_16_32().

const rb_transcoder rb_to_UTF_32LE

static

Initial value:
= {
"UTF-8", "UTF-32LE", from_UTF_8,
TRANSCODE_TABLE_INFO,
1,
4,
4,
asciicompat_encoder,
0, NULL, NULL,
NULL, NULL, NULL, fun_so_to_utf_32le
}

Definition at line 773 of file utf_16_32.c.

Referenced by Init_utf_16_32().

const unsigned char utf_16_32_byte_array[1288]

static

Definition at line 10 of file utf_16_32.c.

const unsigned int utf_16_32_word_array[106]

static

Definition at line 138 of file utf_16_32.c.