Lines Matching defs:charset

136 /* We represent UTF-8 as an XlcGLGR charset, not in extended segments. */
171 * Parses the header of a Compound Text segment, i.e. the charset designator.
174 * 0 (no valid charset designator),
179 * to point past the charset designator. If the return value is one of
182 * *final_byte is set to the "final byte" of the charset designator.
309 * Returns True if the charset can be used with Compound Text.
315 XlcCharSet charset)
319 const char *ptr = charset->ct_sequence;
354 charset->char_size = char_size;
360 charset->side = XlcGL;
361 charset->set_size = 94;
365 charset->side = XlcGR;
366 charset->set_size = 94;
369 charset->side = XlcGR;
370 charset->set_size = 96;
374 charset->side = XlcGLGR;
375 charset->set_size = 0;
391 XlcCharSet charset;
441 XlcCharSet charset)
446 if (ct_info->charset == charset)
461 XlcCharSet charset;
467 charset = _XlcGetCharSet(name);
468 if (charset != NULL) {
469 /* Even if the charset already exists, it is OK to register a second
472 /* Attempt to create the charset. */
473 charset = _XlcCreateDefaultCharSet(name, ct_sequence);
474 if (charset == NULL)
476 _XlcAddCharSet(charset);
483 return charset;
485 ct_info->charset = charset;
508 const char *q = charset->encoding_name;
515 return charset;
520 return charset;
549 if (existing_info->charset != charset
552 && !(strncmp(existing_info->charset->name, "JISX0208", 8) == 0
553 && strncmp(charset->name, "JISX0208", 8) == 0)) {
556 charset->name, existing_info->charset->name);
557 if (strcmp(charset->ct_sequence, ct_sequence) == 0)
558 charset->ct_sequence = "";
563 return charset;
573 XlcCharSet charset; /* The charset of the current segment */
574 XlcCharSet GL_charset; /* The charset responsible for 0x00..0x7F */
575 XlcCharSet GR_charset; /* The charset responsible for 0x80..0xFF */
595 XlcCharSet charset;
641 charset = ct_info->charset;
644 state->charset = charset;
650 state->Other_charset = charset;
652 if (charset->side == XlcGL) {
653 state->GL_charset = charset;
654 } else if (charset->side == XlcGR) {
655 state->GR_charset = charset;
657 state->GL_charset = charset;
658 state->GR_charset = charset;
687 state->GL_charset = state->charset = default_GL_charset;
708 XlcCharSet charset = NULL;
732 /* XXX Just continue with previous charset. */
746 /* Find the charset which is responsible for this byte. */
750 /* Set the charset of this run, or continue the current run,
752 if (charset) {
753 if (charset != ch_charset)
756 state->charset = charset = ch_charset;
761 if (charset->char_size > 0) {
762 if (buf_len < charset->char_size)
767 if (charset->ct_sequence[0] == XctESC
768 && charset->ct_sequence[1] == XctOtherCoding
769 && charset->ct_sequence[2] == 'G') {
790 /* Set the charset of this run, or continue the current run,
792 if (charset) {
793 if (charset != state->charset)
796 charset = state->charset;
799 char_size = charset->char_size;
813 if (strcmp(charset->name, "ISO10646-1") == 0) {
846 /* 'charset' is the charset for the current run. In some cases,
847 'state->charset' contains the charset for the next run. Therefore,
848 return 'charset'.
849 'charset' may still be NULL only if no output was produced. */
851 *((XlcCharSet *) args[0]) = charset;
879 XlcCharSet charset;
895 charset = (XlcCharSet) args[0];
897 ct_info = _XlcGetCTInfoFromCharSet(charset);
901 side = charset->side;
907 /* Output the Escape sequence for switching to the charset, and
916 /* Test whether the charset is already active. */
918 && charset != state->GR_charset)
920 && charset != state->GL_charset)) {
922 /* Output the Escape sequence for switching to the charset. */
952 /* If the charset has side GL or GR, prepare remapping the characters
954 if (charset->set_size) {
957 if (charset->set_size == 94) {
959 if (charset->char_size > 1 || side == XlcGR)
966 char_size = charset->char_size;
969 if (charset->set_size) {
1015 if ((charset->ct_sequence[0] == XctESC
1016 && charset->ct_sequence[1] == XctOtherCoding
1017 && charset->ct_sequence[2] == 'G')
1019 || strcmp(charset->name, "ISO10646-1") == 0
1060 state->GR_charset = charset;
1062 state->GL_charset = charset;
1270 XlcCharSet charset;
1276 charset = _XlcAddCT(ct_data->name, ct_data->ct_sequence);
1277 if (charset == NULL)
1279 if (strncmp(charset->ct_sequence, "\x1b\x25\x2f", 3) != 0)
1280 charset->source = CSsrcStd;
1282 charset->source = CSsrcXLC;