X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fcoding.c;h=3a7bfc1048e55358a064571465e73af140eed83f;hb=3b29c2be9bc7b339f2d62c0add0f488b55f7126b;hp=3828d2cda576a6ef62239ab825507c5dd379df20;hpb=1359a5c46aaaa266d1d6a0f30f2478a18e439b5c;p=m17n%2Fm17n-lib.git diff --git a/src/coding.c b/src/coding.c index 3828d2c..3a7bfc1 100644 --- a/src/coding.c +++ b/src/coding.c @@ -37,20 +37,19 @@ /***ja @addtogroup m17nConv - @brief ¥³¡¼¥É·Ï¥ª¥Ö¥¸¥§¥¯¥È¤È¤½¤ì¤Ë´Ø¤¹¤ë API + @brief ¥³¡¼¥É·Ï¥ª¥Ö¥¸¥§¥¯¥È¤È¤½¤ì¤Ë´Ø¤¹¤ë API. - m17n ¥é¥¤¥Ö¥é¥ê¤Ï¡¢Éä¹æ²½Ê¸»ú½¸¹ç (coded character sets; CCS) ¤Îʸ - »úÉä¹ç²½Êý¼° (character encoding scheme; CES) ¤ò @e ¥³¡¼¥É·Ï ¤È¸Æ - ¤Ö¥ª¥Ö¥¸¥§¥¯¥È¤Çɽ¸½¤¹¤ë¡£m17n ¥é¥¤¥Ö¥é¥ê¤¬¥µ¥Ý¡¼¥È¤¹¤ëCES ¤Ï¡¢ - UTF-8, UTF-16, ISO-2022, DIRECT-CHARSET, ¤½¤Î¾¡¢¤ËÂçÊ̤µ¤ì¤ë¡£¥¢ - ¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤¬Æȼ«¤Ë¥³¡¼¥É·Ï¤òÄɲ乤뤳¤È¤â²Äǽ¤Ç¤¢¤ë¡£ + m17n ¥é¥¤¥Ö¥é¥ê¤Ï¡¢Éä¹æ²½Ê¸»ú½¸¹ç (coded character set; CCS) + ¤Îʸ»úÉä¹ç²½Êý¼° (character encoding scheme; CES) ¤ò @e ¥³¡¼¥É·Ï + ¤È¸Æ¤Ö¥ª¥Ö¥¸¥§¥¯¥È¤Çɽ¸½¤¹¤ë¡£ + ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤ÏÆȼ«¤Ë¥³¡¼¥É·Ï¤òÄɲ乤뤳¤È¤â¤Ç¤­¤ë¡£ - ¥³¡¼¥É¥Ý¥¤¥ó¥È¤«¤éʸ»ú¥³¡¼¥É¤Ø¤ÎÊÑ´¹¤ò @e ¥¨¥ó¥³¡¼¥É ¤È¸Æ¤Ó¡¢Ê¸»ú - ¥³¡¼¥É¤«¤é¥³¡¼¥É¥Ý¥¤¥ó¥È¤Ø¤ÎÊÑ´¹¤ò @e ¥Ç¥³¡¼¥É ¤È¸Æ¤Ö¡£ + ¥³¡¼¥É¥Ý¥¤¥ó¥È¤«¤éʸ»ú¥³¡¼¥É¤Ø¤ÎÊÑ´¹¤ò @e ¥¨¥ó¥³¡¼¥É + ¤È¸Æ¤Ó¡¢Ê¸»ú¥³¡¼¥É¤«¤é¥³¡¼¥É¥Ý¥¤¥ó¥È¤Ø¤ÎÊÑ´¹¤ò @e ¥Ç¥³¡¼¥É ¤È¸Æ¤Ö¡£ - ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï¡¢»ØÄꤵ¤ì¤¿¥³¡¼¥É·Ï¤Ç¥Ð¥¤¥ÈÎó¤ò¥Ç¥³¡¼ - ¥É¤¹¤ë¤³¤È¤Ç M-text ¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤Þ¤¿µÕ¤Ë¡¢»ØÄꤵ¤ì¤¿¥³¡¼¥É - ·Ï¤Ç M-text ¤ò¥¨¥ó¥³¡¼¥É¤·¤¹¤ë¤³¤È¤Ç¥Ð¥¤¥ÈÎó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ */ + ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï¡¢»ØÄꤵ¤ì¤¿¥³¡¼¥É·Ï¤Ç¥Ð¥¤¥ÈÎó¤ò¥Ç¥³¡¼¥É¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ + M-text ¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤Þ¤¿µÕ¤Ë¡¢»ØÄꤵ¤ì¤¿¥³¡¼¥É·Ï¤Ç M-text + ¤ò¥¨¥ó¥³¡¼¥É¤·¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥Ð¥¤¥ÈÎó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ */ /*=*/ @@ -100,7 +99,7 @@ typedef struct reseting a converter. */ int (*resetter) (MConverter *converter); - int (*decoder) (unsigned char *str, int str_bytes, MText *mt, + int (*decoder) (const unsigned char *str, int str_bytes, MText *mt, MConverter *converter); int (*encoder) (MText *mt, int from, int to, @@ -372,6 +371,7 @@ encode_unsupporeted_char (int c, unsigned char *dst, unsigned char *dst_end, if (dst + len > dst_end) return 0; + mtext_put_prop (mt, pos, pos + 1, Mcoding, Mnil); format = (c < 0xD800 ? "" : c < 0xE000 ? "" : c < 0x10000 ? "" @@ -390,8 +390,8 @@ encode_unsupporeted_char (int c, unsigned char *dst, unsigned char *dst_end, static int finish_decoding (MText *mt, MConverter *converter, int nchars, - unsigned char *source, unsigned char *src_end, - unsigned char *src, + const unsigned char *source, const unsigned char *src_end, + const unsigned char *src, int error) { MConverterStatus *internal = (MConverterStatus *) converter->internal_info; @@ -420,7 +420,7 @@ finish_decoding (MText *mt, MConverter *converter, int nchars, { unsigned char *dst = mt->data + mt->nbytes; unsigned char *dst_end = mt->data + mt->allocated; - unsigned char *src_stop = src_end; + const unsigned char *src_stop = src_end; int c; int last_nchars = nchars; @@ -511,15 +511,15 @@ reset_coding_charset (MConverter *converter) } static int -decode_coding_charset (unsigned char *source, int src_bytes, MText *mt, +decode_coding_charset (const unsigned char *source, int src_bytes, MText *mt, MConverter *converter) { MConverterStatus *internal = (MConverterStatus *) converter->internal_info; MCodingSystem *coding = internal->coding; - unsigned char *src = internal->carryover; - unsigned char *src_stop = src + internal->carryover_bytes; - unsigned char *src_end = source + src_bytes; - unsigned char *src_base; + const unsigned char *src = internal->carryover; + const unsigned char *src_stop = src + internal->carryover_bytes; + const unsigned char *src_end = source + src_bytes; + const unsigned char *src_base; unsigned char *dst = mt->data + mt->nbytes; unsigned char *dst_end = mt->data + mt->allocated; int nchars = 0; @@ -712,15 +712,15 @@ encode_coding_charset (MText *mt, int from, int to, static int -decode_coding_utf_8 (unsigned char *source, int src_bytes, MText *mt, +decode_coding_utf_8 (const unsigned char *source, int src_bytes, MText *mt, MConverter *converter) { MConverterStatus *internal = (MConverterStatus *) converter->internal_info; MCodingSystem *coding = internal->coding; - unsigned char *src = internal->carryover; - unsigned char *src_stop = src + internal->carryover_bytes; - unsigned char *src_end = source + src_bytes; - unsigned char *src_base; + const unsigned char *src = internal->carryover; + const unsigned char *src_stop = src + internal->carryover_bytes; + const unsigned char *src_end = source + src_bytes; + const unsigned char *src_base; unsigned char *dst = mt->data + mt->nbytes; unsigned char *dst_end = mt->data + mt->allocated; int nchars = 0; @@ -921,14 +921,14 @@ reset_coding_utf (MConverter *converter) } static int -decode_coding_utf_16 (unsigned char *source, int src_bytes, MText *mt, +decode_coding_utf_16 (const unsigned char *source, int src_bytes, MText *mt, MConverter *converter) { MConverterStatus *internal = (MConverterStatus *) converter->internal_info; - unsigned char *src = internal->carryover; - unsigned char *src_stop = src + internal->carryover_bytes; - unsigned char *src_end = source + src_bytes; - unsigned char *src_base; + const unsigned char *src = internal->carryover; + const unsigned char *src_stop = src + internal->carryover_bytes; + const unsigned char *src_end = source + src_bytes; + const unsigned char *src_base; unsigned char *dst = mt->data + mt->nbytes; unsigned char *dst_end = mt->data + mt->allocated; int nchars = 0; @@ -1025,14 +1025,14 @@ decode_coding_utf_16 (unsigned char *source, int src_bytes, MText *mt, static int -decode_coding_utf_32 (unsigned char *source, int src_bytes, MText *mt, +decode_coding_utf_32 (const unsigned char *source, int src_bytes, MText *mt, MConverter *converter) { MConverterStatus *internal = (MConverterStatus *) converter->internal_info; - unsigned char *src = internal->carryover; - unsigned char *src_stop = src + internal->carryover_bytes; - unsigned char *src_end = source + src_bytes; - unsigned char *src_base; + const unsigned char *src = internal->carryover; + const unsigned char *src_stop = src + internal->carryover_bytes; + const unsigned char *src_end = source + src_bytes; + const unsigned char *src_base; unsigned char *dst = mt->data + mt->nbytes; unsigned char *dst_end = mt->data + mt->allocated; int nchars = 0; @@ -1524,15 +1524,15 @@ find_ctext_non_standard_charset (char *charset_name) } static int -decode_coding_iso_2022 (unsigned char *source, int src_bytes, MText *mt, +decode_coding_iso_2022 (const unsigned char *source, int src_bytes, MText *mt, MConverter *converter) { MConverterStatus *internal = (MConverterStatus *) converter->internal_info; MCodingSystem *coding = internal->coding; - unsigned char *src = internal->carryover; - unsigned char *src_stop = src + internal->carryover_bytes; - unsigned char *src_end = source + src_bytes; - unsigned char *src_base; + const unsigned char *src = internal->carryover; + const unsigned char *src_stop = src + internal->carryover_bytes; + const unsigned char *src_end = source + src_bytes; + const unsigned char *src_base; unsigned char *dst = mt->data + mt->nbytes; unsigned char *dst_end = mt->data + mt->allocated; int nchars = 0; @@ -2634,7 +2634,7 @@ reset_coding_sjis (MConverter *converter) MSymbol kana_sym = msymbol ("jisx0201-kana"); MCharset *kana = MCHARSET (kana_sym); - if (! kanji_sym || ! kana_sym) + if (! kanji || ! kana) return -1; coding->ncharsets = 3; coding->charsets[1] = kanji; @@ -2645,15 +2645,15 @@ reset_coding_sjis (MConverter *converter) } static int -decode_coding_sjis (unsigned char *source, int src_bytes, MText *mt, +decode_coding_sjis (const unsigned char *source, int src_bytes, MText *mt, MConverter *converter) { MConverterStatus *internal = (MConverterStatus *) converter->internal_info; MCodingSystem *coding = internal->coding; - unsigned char *src = internal->carryover; - unsigned char *src_stop = src + internal->carryover_bytes; - unsigned char *src_end = source + src_bytes; - unsigned char *src_base; + const unsigned char *src = internal->carryover; + const unsigned char *src_stop = src + internal->carryover_bytes; + const unsigned char *src_end = source + src_bytes; + const unsigned char *src_base; unsigned char *dst = mt->data + mt->nbytes; unsigned char *dst_end = mt->data + mt->allocated - MAX_UTF8_CHAR_BYTES; int nchars = 0; @@ -2818,14 +2818,19 @@ find_coding (MSymbol name) if (! coding) { - MPlist *param = mplist_get (coding_definition_list, name); + MPlist *plist, *pl; + MSymbol sym = msymbol__canonicalize (name); - if (! param) + plist = mplist_find_by_key (coding_definition_list, sym); + if (! plist) return NULL; - param = mplist__from_plist (param); - mconv_define_coding (MSYMBOL_NAME (name), param, NULL, NULL, NULL, NULL); + pl = MPLIST_PLIST (plist); + name = MPLIST_VAL (pl); + mconv_define_coding (MSYMBOL_NAME (name), MPLIST_NEXT (pl), + NULL, NULL, NULL, NULL); coding = (MCodingSystem *) msymbol_get (name, Mcoding); - M17N_OBJECT_UNREF (param); + plist = mplist_pop (plist); + M17N_OBJECT_UNREF (plist); } return coding; } @@ -2989,7 +2994,11 @@ mcoding__fini (void) if (coding->extra_info) free (coding->extra_info); if (coding->extra_spec) - free (coding->extra_spec); + { + if (coding->type == Miso_2022) + free (((struct iso_2022_spec *) coding->extra_spec)->designations); + free (coding->extra_spec); + } free (coding); } MLIST_FREE1 (&coding_list, codings); @@ -2999,31 +3008,19 @@ mcoding__fini (void) } void -mconv__define_coding_from_charset (MSymbol sym) -{ - MPlist *param = mplist (), *charsets = mplist (); - - mplist_set (charsets, Msymbol, sym); - mplist_add (param, Mtype, Mcharset); - mplist_add (param, Mcharsets, charsets); - mconv_define_coding (msymbol_name (sym), param, NULL, NULL, NULL, NULL); - M17N_OBJECT_UNREF (charsets); - M17N_OBJECT_UNREF (param); -} - -void mconv__register_charset_coding (MSymbol sym) { - if (! mplist_find_by_key (coding_definition_list, sym)) + MSymbol name = msymbol__canonicalize (sym); + + if (! mplist_find_by_key (coding_definition_list, name)) { MPlist *param = mplist (), *charsets = mplist (); mplist_set (charsets, Msymbol, sym); - mplist_add (param, Msymbol, Mtype); - mplist_add (param, Msymbol, Mcharset); - mplist_add (param, Msymbol, Mcharsets); - mplist_add (param, Mplist, charsets); - mplist_put (coding_definition_list, sym, param); + mplist_add (param, Msymbol, sym); + mplist_add (param, Mtype, Mcharset); + mplist_add (param, Mcharsets, charsets); + mplist_put (coding_definition_list, name, param); M17N_OBJECT_UNREF (charsets); } } @@ -3050,7 +3047,7 @@ mcoding__load_from_database () MPLIST_DO (plist, def_list) { MPlist *pl; - MSymbol name; + MSymbol name, canonicalized; if (! MPLIST_PLIST_P (plist)) MERROR (MERROR_CHARSET, -1); @@ -3058,9 +3055,10 @@ mcoding__load_from_database () if (! MPLIST_SYMBOL_P (pl)) MERROR (MERROR_CHARSET, -1); name = MPLIST_SYMBOL (pl); - pl = MPLIST_NEXT (pl); - definitions = mplist_add (definitions, name, pl); - M17N_OBJECT_REF (pl); + canonicalized = msymbol__canonicalize (name); + pl = mplist__from_plist (MPLIST_NEXT (pl)); + mplist_push (pl, Msymbol, name); + definitions = mplist_add (definitions, canonicalized, pl); } M17N_OBJECT_UNREF (def_list); @@ -3078,63 +3076,59 @@ mcoding__load_from_database () /*** @{ */ /*=*/ -/***en @name Variables: Symbols representing a coding system */ +/***en @name Variables: Symbols representing coding systems */ /***ja @name ÊÑ¿ô: ÄêµÁºÑ¤ß¥³¡¼¥É·Ï¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë */ /*** @{ */ /*=*/ /***en - @brief Symbol for the coding system US-ASCII + @brief Symbol for the coding system US-ASCII. The symbol #Mcoding_us_ascii has name "us-ascii" and represents a coding system for the CES US-ASCII. */ /***ja - @brief MIME charset "US-ASCII" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë + @brief US-ASCII ¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë. - ¥·¥ó¥Ü¥ë @c Mcoding_us_ascii ¤Ï "us-ascii" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢ - MIME charset "US-ASCII" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤ò»ØÄꤹ¤ë¤¿¤á - ¤Ë»È¤ï¤ì¤ë¡£ - */ + ¥·¥ó¥Ü¥ë #Mcoding_us_ascii ¤Ï "us-ascii" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢ + CES US-ASCII ÍѤΥ³¡¼¥É·Ï¤ò¼¨¤¹¡£ + */ MSymbol Mcoding_us_ascii; /*=*/ /***en - @brief Symbol for the coding system ISO-8859-1 + @brief Symbol for the coding system ISO-8859-1. The symbol #Mcoding_iso_8859_1 has name "iso-8859-1" and represents a coding system for the CES ISO-8859-1. */ /***ja - @brief MIME charset "ISO-8859-1" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë + @brief ISO-8859-1 ¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë. - ¥·¥ó¥Ü¥ë @c Mcoding_iso_8859_1 ¤Ï "iso-8859-1" ¤È¤¤¤¦Ì¾Á° - ¤ò»ý¤Á¡¢MIME charset "ISO-8859-1" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤ò»Ø - Äꤹ¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ */ + ¥·¥ó¥Ü¥ë #Mcoding_iso_8859_1 ¤Ï "iso-8859-1" + ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢CES ISO-8859-1 ÍѤΥ³¡¼¥É·Ï¤ò¼¨¤¹¡£ */ MSymbol Mcoding_iso_8859_1; /*=*/ /***en - @brief Symbol for the coding system UTF-8 + @brief Symbol for the coding system UTF-8. The symbol #Mcoding_utf_8 has name "utf-8" and represents a coding system for the CES UTF-8. */ /***ja - @brief RFC 2279 ¤Î "UTF-8" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë¡ÊUnicode ÍÑ¡Ë + @brief UTF-8 ¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë. - ¥·¥ó¥Ü¥ë @c Mcoding_utf_8 ¤Ï "utf-8" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢ - RFC 2279 ¤ÇÄêµÁ¤µ¤ì¤ë"UTF-8" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤ò»ØÄꤹ¤ë - ¤¿¤á¤Ë»È¤ï¤ì¤ë¡£¤³¤Î¥³¡¼¥É·Ï¤Ï Unicode ¤ÎÁ´¤Æ¤Îʸ»ú¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ + ¥·¥ó¥Ü¥ë #Mcoding_utf_8 ¤Ï "utf-8" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢CES + UTF-8 ÍѤΥ³¡¼¥É·Ï¤ò¼¨¤¹¡£ */ MSymbol Mcoding_utf_8; /*=*/ /***en - @brief UTF-8-FULL - + @brief Symbol for the coding system UTF-8-FULL. The symbol #Mcoding_utf_8_full has name "utf-8-full" and represents a coding system that is a extension of UTF-8. This @@ -3143,81 +3137,116 @@ MSymbol Mcoding_utf_8; supported by the m17n library. */ /***ja - @brief RFC 2279 ¤Î "UTF-8" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë¡ÊÁ´Ê¸»úÍÑ¡Ë + @brief UTF-8-FULL ¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë. - ¥·¥ó¥Ü¥ë @c Mcoding_utf_8_full ¤Ï "utf-8-full" ¤È¤¤¤¦Ì¾Á° - ¤ò»ý¤Á¡¢RFC 2279 ¤ÇÄêµÁ¤µ¤ì¤ë"UTF-8" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤ò - »ØÄꤹ¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£¤³¤Î¥³¡¼¥É·Ï¤Ï m17n ¥é¥¤¥Ö¥é¥ê¤¬°·¤¦Á´¤Æ¤Î - ʸ»ú¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ */ + ¥·¥ó¥Ü¥ë #Mcoding_utf_8_full ¤Ï "utf-8-full" + ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢"UTF-8" ¤Î³ÈÄ¥¤Ç¤¢¤ë¥³¡¼¥É·Ï¤ò¼¨¤¹¡£ + ¤³¤Î¥³¡¼¥É·Ï¤Ï UTF-8 ¤ÈƱ¤¸¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¥¢¥ë¥´¥ê¥º¥à¤òÍѤ¤¤ë¤¬¡¢ÂÐ¾Ý¤Ï + Unicode ʸ»ú¤Ë¤Ï¸ÂÄꤵ¤ì¤Ê¤¤¡£ + ¤Þ¤¿m17n ¥é¥¤¥Ö¥é¥ê¤¬°·¤¦Á´¤Æ¤Îʸ»ú¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + */ MSymbol Mcoding_utf_8_full; /*=*/ /***en - @brief UTF-16 + @brief Symbol for the coding system UTF-16. The symbol #Mcoding_utf_16 has name "utf-16" and represents a coding system for the CES UTF-16 (RFC 2279). */ /***ja - @brief RFC 2781 ¤Î "UTF-16" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë + @brief UTF-16 ¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë. - ¥·¥ó¥Ü¥ë @c Mcoding_utf_16 ¤Ï "utf-16" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢ - RFC 2279 ¤ÇÄêµÁ¤µ¤ì¤ë"UTF-16" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤ò»ØÄꤹ - ¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£¤³¤Î¥³¡¼¥É·Ï¤Ï Unicode ¤ÎÁ´¤Æ¤Îʸ»ú¤ò¥µ¥Ý¡¼¥È¤¹ - ¤ë¡£ */ + ¥·¥ó¥Ü¥ë #Mcoding_utf_16 ¤Ï "utf-16" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢ + CES UTF-16 (RFC 2279) ÍѤΥ³¡¼¥É·Ï¤ò¼¨¤¹¡£ + */ MSymbol Mcoding_utf_16; /*=*/ /***en - @brief UTF-16BE + @brief Symbol for the coding system UTF-16BE. The symbol #Mcoding_utf_16be has name "utf-16be" and represents a coding system for the CES UTF-16BE (RFC 2279). */ +/***ja + @brief UTF-16BE ¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë. + + ¥·¥ó¥Ü¥ë #Mcoding_utf_16be ¤Ï "utf-16be" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢ + CES UTF-16BE (RFC 2279) ÍѤΥ³¡¼¥É·Ï¤ò¼¨¤¹¡£ */ + MSymbol Mcoding_utf_16be; /*=*/ /***en - @brief UTF-16LE + @brief Symbol for the coding system UTF-16LE. The symbol #Mcoding_utf_16le has name "utf-16le" and represents a coding system for the CES UTF-16LE (RFC 2279). */ +/***ja + @brief UTF-16LE ¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë. + + ¥·¥ó¥Ü¥ë #Mcoding_utf_16le ¤Ï "utf-16le" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢ + CES UTF-16LE (RFC 2279) ÍѤΥ³¡¼¥É·Ï¤ò¼¨¤¹¡£ */ + MSymbol Mcoding_utf_16le; /*=*/ /***en - @brief UTF-32 + @brief Symbol for the coding system UTF-32. The symbol #Mcoding_utf_32 has name "utf-32" and represents a coding system for the CES UTF-32 (RFC 2279). */ +/***ja + @brief UTF-32 ¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë. + + ¥·¥ó¥Ü¥ë #Mcoding_utf_32 ¤Ï "utf-32" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢ + CES UTF-32 (RFC 2279) ÍѤΥ³¡¼¥É·Ï¤ò¼¨¤¹¡£ */ + MSymbol Mcoding_utf_32; /*=*/ /***en - @brief UTF-32be + @brief Symbol for the coding system UTF-32BE. The symbol #Mcoding_utf_32be has name "utf-32be" and represents a coding system for the CES UTF-32BE (RFC 2279). */ +/***ja + @brief UTF-32BE ¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë. + + ¥·¥ó¥Ü¥ë #Mcoding_utf_32be ¤Ï "utf-32be" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢ + CES UTF-32BE (RFC 2279) ÍѤΥ³¡¼¥É·Ï¤ò¼¨¤¹¡£ */ MSymbol Mcoding_utf_32be; /*=*/ /***en - @brief UTF-32LE + @brief Symbol for the coding system UTF-32LE. The symbol #Mcoding_utf_32le has name "utf-32le" and represents a coding system for the CES UTF-32LE (RFC 2279). */ +/***ja + @brief UTF-32LE ¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë. + + ¥·¥ó¥Ü¥ë #Mcoding_utf_32le ¤Ï "utf-32le" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢ + CES UTF-32LE (RFC 2279) ÍѤΥ³¡¼¥É·Ï¤ò¼¨¤¹¡£ */ + MSymbol Mcoding_utf_32le; /*=*/ /***en - @brief SJIS + @brief Symbol for the coding system SJIS. The symbol #Mcoding_sjis has name "sjis" and represents a coding system for the CES Shift-JIS. */ +/***ja + @brief SJIS ¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë. + + ¥·¥ó¥Ü¥ë #Mcoding_sjis has ¤Ï "sjis" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢ + CES Shift-JISÍѤΥ³¡¼¥É·Ï¤ò¼¨¤¹¡£ */ MSymbol Mcoding_sjis; /*** @} */ @@ -3225,11 +3254,15 @@ MSymbol Mcoding_sjis; /***en @name Variables: Parameter keys for mconv_define_coding (). */ +/***ja + @name ÊÑ¿ô: mconv_define_coding () Íѥѥé¥á¡¼¥¿¥­¡¼ */ /*** @{ */ /*=*/ /***en Parameter key for mconv_define_coding () (which see). */ +/***ja + mconv_define_coding () Íѥѥé¥á¡¼¥¿¥­¡¼ (¾ÜºÙ¤Ï mconv_define_coding ()»²¾È). */ MSymbol Mtype; /*=*/ @@ -3244,7 +3277,9 @@ MSymbol Mlittle_endian; /*=*/ /***en - @name Variables: Symbols representing coding system type. */ + @name Variables: Symbols representing coding system types. */ +/***ja + @name ÊÑ¿ô¡§ ¥³¡¼¥É·Ï¤Î¥¿¥¤¥×¤ò¼¨¤¹¥·¥ó¥Ü¥ë. */ /*** @{ */ /*=*/ @@ -3252,6 +3287,10 @@ MSymbol Mlittle_endian; Symbol that can be a value of the #Mtype parameter of a coding system used in an argument to the mconv_define_coding () function (which see). */ +/***ja + ´Ø¿ô mconv_define_coding () ¤Î°ú¿ô¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¥³¡¼¥É·Ï¤Î¥Ñ¥é¥á¡¼¥¿ + #Mtype ¤ÎÃͤȤʤêÆÀ¤ë¥·¥ó¥Ü¥ë¡£(¾ÜºÙ¤Ï + mconv_define_coding ()»²¾È)¡£ */ MSymbol Mutf; /*=*/ @@ -3261,14 +3300,20 @@ MSymbol Miso_2022; /*=*/ /***en - @name Variables: Symbols appearing in the value of #Mfrag parameter. */ + @name Variables: Symbols appearing in the value of #Mflags parameter. */ +/***ja + @name ÊÑ¿ô¡§ ¥Ñ¥é¥á¡¼¥¿ #Mflags ¤ÎÃͤȤʤêÆÀ¤ë¥·¥ó¥Ü¥ë. */ /*** @{ */ /*=*/ /***en - Symbol that can be a value of the #Mflags parameter of a coding + Symbols that can be a value of the #Mflags parameter of a coding system used in an argument to the mconv_define_coding () function (which see). */ +/***ja + ´Ø¿ô mconv_define_coding () ¤Î°ú¿ô¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¥³¡¼¥É·Ï¤Î¥Ñ¥é¥á¡¼¥¿ + #Mflags ¤ÎÃͤȤʤêÆÀ¤ë¥·¥ó¥Ü¥ë¡£(¾ÜºÙ¤Ï + mconv_define_coding ()»²¾È)¡£ */ MSymbol Mreset_at_eol; /*=*/ MSymbol Mreset_at_cntl; @@ -3292,7 +3337,9 @@ MSymbol Mfull_support; @name Variables: etc Remaining variables. */ -/***ja @name ÊÑ¿ô: ¤½¤Î¾ */ +/***ja @name ÊÑ¿ô: ¤½¤Î¾ + + ¤Û¤«¤ÎÊÑ¿ô¡£ */ /*** @{ */ /*=*/ /***en @@ -3301,23 +3348,29 @@ MSymbol Mfull_support; The variable #Mmaybe is a symbol of name "maybe". It is used a value of #Mbom parameter of the function mconv_define_coding () (which see). */ +/***ja + @brief "maybe"¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë. + + ÊÑ¿ô #Mmaybe ¤Ï "maybe" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¡£¤³¤ì¤Ï´Ø¿ô + mconv_define_coding () ¥Ñ¥é¥á¡¼¥¿ #Mbom ¤ÎÃͤȤ·¤ÆÍѤ¤¤é¤ì¤ë¡£ + (¾ÜºÙ¤Ï mconv_define_coding () »²¾È)¡£ */ MSymbol Mmaybe; /*=*/ /***en - @brief The symbol @c Mcoding + @brief The symbol @c Mcoding. Any decoded M-text has a text property whose key is the predefined symbol @c Mcoding. The name of @c Mcoding is "coding". */ /***ja - @brief ¥·¥ó¥Ü¥ë @c Mcoding + @brief ¥·¥ó¥Ü¥ë @c Mcoding. - ¥Ç¥³¡¼¥É¤µ¤ì¤¿ M-text ¤Ï¡¢¥­¡¼¤¬ @c Mcoding ¤Ç¤¢¤ë¤è¤¦¤Ê¥Æ¥­¥¹¥È¥× - ¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¥·¥ó¥Ü¥ë @c Mcoding ¤Ï "coding" ¤È¤¤¤¦Ì¾ - Á°¤Ç¤¢¤é¤«¤¸¤áÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ */ + ¥Ç¥³¡¼¥É¤µ¤ì¤¿ M-text ¤Ï¤¹¤Ù¤Æ¡¢¥­¡¼¤¬ÄêµÁºÑ¤ß¥·¥ó¥Ü¥ë @c Mcoding + ¤Ç¤¢¤ë¤è¤¦¤Ê¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¥·¥ó¥Ü¥ë @c Mcoding ¤Ï + "coding" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¡£ */ MSymbol Mcoding; /*=*/ @@ -3325,11 +3378,11 @@ MSymbol Mcoding; /*=*/ /***en - @brief Define a coding system + @brief Define a coding system. The mconv_define_coding () function defines a new coding system - and makes it accessive via a symbol whose name is $NAME. $PLIST - specifies parameters of the charset as below: + and makes it accessible via a symbol whose name is $NAME. $PLIST + specifies parameters of the coding system as below:
    @@ -3340,12 +3393,12 @@ MSymbol Mcoding; If the type is #Mcharset, $EXTRA_INFO is ignored. - If the type is #Miso_2022, $EXTRA_INFO must be a pointer to - #MCodingInfoISO2022. - If the type is #Mutf, $EXTRA_INFO must be a pointer to #MCodingInfoUTF. + If the type is #Miso_2022, $EXTRA_INFO must be a pointer to + #MCodingInfoISO2022. + If the type is #Mnil, the argument $RESETTER, $DECODER, and $ENCODER must be supplied. $EXTRA_INFO is ignored. Otherwise, they can be @c NULL and the m17n library provides proper defaults. @@ -3359,14 +3412,14 @@ MSymbol Mcoding;
  • Key is #Mflags, value is a plist If the type is #Miso_2022, the values specifies flags to control - the ISO 2022 interpreter. The keys of the plist must e @c - Msymbol, and values must be one of the following. + the ISO 2022 interpreter. The keys of the plist must e #Msymbol, + and values must be one of the following.
    • #Mreset_at_eol - If this flag exits, designation and invocation status is reset to + If this flag exists, designation and invocation status is reset to the initial state at the end of line.
    • #Mreset_at_cntl @@ -3381,7 +3434,7 @@ MSymbol Mcoding;
    • #Mlong_form If this flag exists, the over-long escape sequences (ESC '$' '(' - ) are used for designating the charsets JISX0208.1978, + ) are used for designating the CCS JISX0208.1978, GB2312, and JISX0208.
    • #Mdesignation_g0 @@ -3419,7 +3472,7 @@ MSymbol Mcoding; If this flag exists, use 7-bit single shift code (0x19). -
    • #Meuc_tw_shift; +
    • #Meuc_tw_shift If this flag exists, use a special shifting according to EUC-TW. @@ -3442,8 +3495,8 @@ MSymbol Mcoding;
    • Key is #Mdesignation, value is a plist If the type is #Miso_2022, the value specifies how to designate - each supported characters. The keys of the plist must be @c - Minteger, and the values must be numbers indicating a graphic + each supported characters. The keys of the plist must be + #Minteger, and the values must be numbers indicating a graphic registers. The Nth element value is for the Nth charset of the charset list. The value 0..3 means that it is assumed that a charset is already designated to the graphic register 0..3. The @@ -3521,72 +3574,194 @@ MSymbol Mcoding; If the operation was successful, mconv_define_coding () returns a symbol whose name is $NAME. If an error is detected, it returns - #Mnil and assigns an error code to the external variable @c - merror_code. */ + #Mnil and assigns an error code to the external variable #merror_code. */ /***ja - @brief ¥³¡¼¥É·Ï¤ÎÄêµÁ + @brief ¥³¡¼¥É·Ï¤òÄêµÁ¤¹¤ë. ´Ø¿ô mconv_define_coding () ¤Ï¡¢¿·¤·¤¤¥³¡¼¥É·Ï¤òÄêµÁ¤·¡¢¤½¤ì¤ò - $NAME ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë·Ðͳ¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ + $NAME ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë·Ðͳ¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£ $PLIST + ¤Ç¤ÏÄêµÁ¤¹¤ë¥³¡¼¥É·Ï¤Î¥Ñ¥é¥á¡¼¥¿¤ò°Ê²¼¤Î¤è¤¦¤Ë»ØÄꤹ¤ë¡£ + +
        + +
      • ¥­¡¼¤¬ @c Mtype ¤ÇÃͤ¬¥·¥ó¥Ü¥ë¤Î»þ + + Ãͤϥ³¡¼¥É·Ï¤Î¥¿¥¤¥×¤òɽ¤·¡¢#Mcharset, #Mutf, #Miso_2022, #Mnil + ¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + + ¥¿¥¤¥×¤¬ #Mcharset ¤Ê¤é¤Ð $EXTRA_INFO ¤Ï̵»ë¤µ¤ì¤ë¡£ + + ¥¿¥¤¥×¤¬ #Mutf ¤Ê¤é¤Ð $EXTRA_INFO ¤Ï #MCodingInfoUTF + ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + + ¥¿¥¤¥×¤¬ #Miso_2022¤Ê¤é¤Ð $EXTRA_INFO ¤Ï #MCodingInfoISO2022 + ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + + ¥¿¥¤¥×¤¬ #Mnil ¤Ê¤é¤Ð¡¢°ú¿ô $RESETTER, $DECODER, $ENCODER + ¤òÍ¿¤¨¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£$EXTRA_INFO ¤Ï̵»ë¤µ¤ì¤ë¡£ + ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¤³¤ì¤é¤Ï @c NULL ¤Ç¤è¤¯¡¢ + m17n ¥é¥¤¥Ö¥é¥ê¤¬Å¬Àڤʥǥե©¥ë¥ÈÃͤòÍ¿¤¨¤ë¡£ + +
      • ¥­¡¼¤¬ #Mcharsets ¤ÇÃͤ¬ plist ¤Î»þ + + ÃͤϤ³¤Î¥³¡¼¥É·Ï¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤ëʸ»ú¥»¥Ã¥È¤Î¥ê¥¹¥È¤Ç¤¢¤ë¡£plist¤Î¥­¡¼¤Ï + #Msymbol¡¢ÃͤÏʸ»ú¥»¥Ã¥È¤ò¼¨¤¹¥·¥ó¥Ü¥ë¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +
      • ¥­¡¼¤¬ #Mflags Ãͤ¬ plist ¤Î»þ + + ¥¿¥¤¥×¤¬ #Miso_2022 ¤Ê¤é¤Ð¡¢¤³¤ÎÃͤÏ, ISO 2022 + ¥¤¥ó¥¿¥×¥ê¥¿ÍѤÎÀ©¸æ¥Õ¥é¥Ã¥°¤ò¼¨¤¹¡£plist ¤Î¥­¡¼¤Ï #Msymbol + ¤Ç¤¢¤ê¡¢Ãͤϰʲ¼¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ + +
          + +
        • #Mreset_at_eol + + ¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢¿Þ·Áʸ»ú½¸¹ç¤Î»Ø¼¨¤ä¸Æ½Ð¤Ï¹ÔËö¤Ç¥ê¥»¥Ã¥È¤µ¤ì¤ÆÅö½é¤Î¾õÂÖ¤ËÌá¤ë¡£ + +
        • #Mreset_at_cntl + + ¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢¿Þ·Áʸ»ú½¸¹ç¤Î»Ø¼¨¤ä¸Æ½Ð¤ÏÀ©¸æʸ»ú¤Ë½Ð²ñ¤Ã¤¿»þÅÀ¤Ç¥ê¥»¥Ã¥È¤µ¤ì¤ÆÅö½é¤Î¾õÂÖ¤ËÌá¤ë¡£ + +
        • #Meight_bit + + ¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢¿Þ·Áʸ»ú½¸¹ç¤Î±¦È¾Ì̤¬ÍѤ¤¤é¤ì¤ë¡£ + +
        • #Mlong_form + + ¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢Ê¸»ú½¸¹ç JISX0208.1978, GB2312, JISX0208 + ¤ò»Ø¼¨¤¹¤ëºÝ¤Ë over-long ¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ (ESC '$' '(' + ) ¤¬ÍѤ¤¤é¤ì¤ë¡£ + +
        • #Mdesignation_g0 + + ¤³¤Î¥Õ¥é¥°¤È #Mfull_support ¤¬¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Ë¸½¤ï¤ì¤Ê¤¤Ê¸»ú¥»¥Ã¥È¤ò + G0 ½¸¹ç¤Ë»Ø¼¨¤¹¤ë¡£ + +
        • #Mdesignation_g1 + + ¤³¤Î¥Õ¥é¥°¤È #Mfull_support ¤¬¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Ë¸½¤ï¤ì¤Ê¤¤Ê¸»ú¥»¥Ã¥È¤ò + G1 ½¸¹ç¤Ë»Ø¼¨¤¹¤ë¡£ + +
        • #Mdesignation_ctext + + ¤³¤Î¥Õ¥é¥°¤È #Mfull_support ¤¬¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Ë¸½¤ï¤ì¤Ê¤¤Ê¸»ú¥»¥Ã¥È¤ò + G0 ½¸¹ç¤Þ¤¿¤Ï G1 ½¸¹ç¤Ë¡¢¥³¥ó¥Ñ¥¦¥ó¥É¥Æ¥­¥¹¥È¤Î´ð½à¤Ë¤½¤Ã¤Æ»Ø¼¨¤¹¤ë¡£ + +
        • #Mdesignation_ctext_ext + + ¤³¤Î¥Õ¥é¥°¤È #Mfull_support ¤¬¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Ë¸½¤ï¤ì¤Ê¤¤Ê¸»ú¥»¥Ã¥È¤ò + G0 ½¸¹ç¤Þ¤¿¤Ï G1 ½¸¹ç¤Ë¡¢¤¢¤ë¤¤¤Ï³ÈÄ¥¥»¥°¥á¥ó¥È¤Ë¥³¥ó¥Ñ¥¦¥ó¥É¥Æ¥­¥¹¥È¤Î´ð½à¤Ë¤½¤Ã¤Æ»Ø¼¨¤¹¤ë¡£ + +
        • #Mlocking_shift + + ¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢¥í¥Ã¥­¥ó¥°¥·¥Õ¥È¤òÍѤ¤¤ë¡£ + +
        • #Msingle_shift + + ¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢¥·¥ó¥°¥ë¥·¥Õ¥È¤òÍѤ¤¤ë¡£ + +
        • #Msingle_shift_7 + + ¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢7-bit ¥·¥ó¥°¥ë¥·¥Õ¥È¥³¡¼¥É (0x19) ¤òÍѤ¤¤ë¡£ + +
        • #Meuc_tw_shift + + ¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢EUC-TW ¤Ë±è¤Ã¤¿ÆÃÊ̤ʥ·¥Õ¥È¤òÍѤ¤¤ë¡£ + +
        • #Miso_6429 + + ¸½»þÅÀ¤Ç¤ÏÍѤ¤¤é¤ì¤Æ¤¤¤Ê¤¤¡£ + +
        • #Mrevision_number + + ¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢revision number ¤ò»ý¤Äʸ»ú¥»¥Ã¥È¤ò»Ø¼¨¤¹¤ëºÝ¤Ë + revision number ¥¨¥¹¥±¡¼¥×¥·¡¼¥¯¥¨¥ó¥¹¤òÍѤ¤¤ë¡£ + +
        • #Mfull_support + + ¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢the International Registry + ¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëÁ´Ê¸»ú¥»¥Ã¥È¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ + +
        + +
      • ¥­¡¼¤¬ #Mdesignation¤ÇÃͤ¬ plist ¤Î»þ + + ¥¿¥¤¥×¤¬ #Miso_2022 ¤Ê¤é¤Ð¡¢ÃͤϳÆʸ»ú¤ò¤É¤Î¤è¤¦¤Ë»Ø¼¨¤¹¤ë¤«¤ò¼¨¤¹¡£ + plist ¤Î¥­¡¼¤Ï #Minteger¡¢ÃͤϽ¸¹ç¡Êgraphic register¡Ë + ¤ò¼¨¤¹¿ô»ú¤Ç¤¢¤ë¡£NÈÖÌܤÎÍ×ÁǤÎÃͤϡ¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Î N + ÈÖÌܤÎʸ»ú¥»¥Ã¥È¤ËÂбþ¤¹¤ë¡£Ãͤ¬ 0..3 ¤Ç¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¤¬¤¹¤Ç¤Ë + G0..G3 ¤Ë»Ø¼¨ ¤µ¤ì¤Æ¤¤¤ë¡£ + + Ãͤ¬Éé(-4..-1) ¤Ç¤¢¤ì¤Ð¡¢½é´ü¾õÂ֤ǤÏʸ»ú¥»¥Ã¥È¤¬¤É¤³¤Ë¤â»Ø¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¡¢É¬Í×¤ÊºÝ¤Ë¤Ï + G0..G3 ¤Î¤½¤ì¤¾¤ì¤Ë»Ø¼¨¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ + +
      • ¥­¡¼¤¬ #Minvocation¤ÇÃͤ¬ plist ¤Î»þ - $TYPE ¤Ï Îóµó·¿ #MCodingType ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ê¡¢¥³¡¼¥É·Ï¤Î¹½Â¤¤ò - »ØÄꤹ¤ë¡£ + ¥¿¥¤¥×¤¬ #Miso_2022 ¤Ê¤é¤Ð¡¢Ãͤϳƽ¸¹ç¤ò¤É¤Î¤è¤¦¤Ë¸Æ¤Ó½Ð¤¹¤«¤ò¼¨¤¹¡£ + plist ¤ÎŤµ¤Ï 1 ¤Ê¤¤¤· 2 ¤Ç¤¢¤ë¡£plist ¤Î¥­¡¼¤Ï + #Minteger¡¢ÃͤϽ¸¹ç¡Êgraphic register)¤ò¼¨¤¹¿ô»ú¤Ç¤¢¤ë¡£ + ºÇ½é¤ÎÍ×ÁǤÎÃͤ¬¿Þ·Áʸ»ú½¸¹çº¸È¾Ì̤˸ƤӽФµ¤ì¤ë½¸¹ç¤ò¼¨¤¹¡£ + plist ¤ÎŤµ¤¬ 1 ¤Ê¤é¤Ð¡¢±¦È¾Ì̤ˤϲ¿¤â¸Æ¤Ó½Ð¤µ¤ì¤Ê¤¤¡£ + ¤½¤¦¤Ç¤±¤ì¤Ð¡¢£²¤Ä¤á¤ÎÍ×ÁǤÎÃͤ¬¿Þ·Áʸ»ú½¸¹ç±¦È¾Ì̤˸ƤӽФµ¤ì¤ë½¸¹ç¤ò¼¨¤¹¡£ - $CHARSET_NAMES ¤Ï¥µ¥Ý¡¼¥È¤¹¤ëʸ»ú¥»¥Ã¥È¤òɽ¤ï¤¹¥·¥ó¥Ü¥ë¤ÎÇÛÎó¤Ç¤¢¤ê¡¢ - $NCHARSETS ¤Ï¤½¤ÎÍ×ÁÇ¿ô¤Ç¤¢¤ë¡£ +
      • ¥­¡¼¤¬ #Mcode_unit ¤ÇÃͤ¬À°¿ôÃͤλþ - $TYPE ¤¬ #MCODING_TYPE_MISC ¤Ç¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢$RESETTER, $DECODER, - $ENCODER ¤òÍ¿¤¨¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¤³¤ì¤é¤Ï @c - NULL ¤Ç¹½¤ï¤Ê¤¤¡£¤½¤ÎºÝ¤Ë¤Ï m17n ¥é¥¤¥Ö¥é¥ê¤¬Å¬Àڤʥǥե©¥ë¥ÈÃͤò - Í¿¤¨¤ë¡£ + ¥¿¥¤¥×¤¬ #Mutf ¤Ê¤é¤Ð¡¢Ãͤϥ³¡¼¥É¥æ¥Ë¥Ã¥È¤Î¥Ó¥Ã¥ÈŤǤ¢¤ê¡¢8, 16, + 32 ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ - $RESETTER ¤Ï¤³¤Î¥³¡¼¥É·ÏÍѤΥ³¥ó¥Ð¡¼¥¿¤ò½é´ü¾õÂ֤˥ꥻ¥Ã¥È¤¹¤ë´Ø¿ô - ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¤³¤Î´Ø¿ô¤Ï¥³¥ó¥Ð¡¼¥¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤È - ¤¤¤¦£±°ú¿ô¤ò¤È¤ë¡£ +
      • ¥­¡¼¤¬ #Mbom ¤ÇÃͤ¬¥·¥ó¥Ü¥ë¤Î»þ - $DECODER ¤Ï¥Ð¥¤¥ÈÎó¤ò¤³¤Î¥³¡¼¥É·Ï¤Ë½¾¤Ã¤Æ¥Ç¥³¡¼¥É¤¹¤ë´Ø¿ô¤Ø¤Î¥Ý¥¤ - ¥ó¥¿¤Ç¤¢¤ë¡£¤³¤Î´Ø¿ô¤Ï°Ê²¼¤Î4°ú¿ô¤ò¤È¤ë¡£ + ¥¿¥¤¥×¤¬ #Mutf ¤Ç¥³¡¼¥É¥æ¥Ë¥Ã¥È¤Î¥Ó¥Ã¥ÈŤ¬ 16 ¤« 32¤Ê¤é¤Ð¡¢ÃÍ¤Ï + BOM (Byte Order Mark) ¤ò»ÈÍѤ¹¤ë¤«¤É¤¦¤«¤ò¼¨¤¹¡£Ãͤ¬¥Ç¥Õ¥©¥ë¥ÈÃͤΠ+ #Mnil ¤Ê¤é¤Ð¡¢»ÈÍѤ·¤Ê¤¤¡£Ãͤ¬ #Mmaybe ¤Ê¤é¤Ð¥Ç¥³¡¼¥É»þ¤Ë BOM + ¤¬¤¢¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£¤½¤ì°Ê³°¤Ê¤é¤Ð»ÈÍѤ¹¤ë¡£ + +
      • ¥­¡¼¤¬ #Mlittle_endian ¤ÇÃͤ¬¥·¥ó¥Ü¥ë¤Î»þ + + ¥¿¥¤¥×¤¬ #Mutf ¤Ç¥³¡¼¥É¥æ¥Ë¥Ã¥È¤Î¥Ó¥Ã¥ÈŤ¬ 16 ¤« 32 + ¤Ê¤é¤Ð¡¢Ãͤϥ¨¥ó¥³¡¼¥É¤¬ little endian ¤«¤É¤¦¤«¤ò¼¨¤¹¡£Ãͤ¬¥Ç¥Õ¥©¥ë¥ÈÃͤΠ+ #Mnil ¤Ê¤é¤Ð big endian ¤Ç¤¢¤ê¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð little endian ¤Ç¤¢¤ë¡£ + +
      - @li ¥Ð¥¤¥ÈÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ + $RESETTER + ¤Ï¤³¤Î¥³¡¼¥É·ÏÍѤΥ³¥ó¥Ð¡¼¥¿¤ò½é´ü¾õÂ֤˥ꥻ¥Ã¥È¤¹¤ë´Ø¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ + ¤³¤Î´Ø¿ô¤Ï¥³¥ó¥Ð¡¼¥¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤¤¤¦£±°ú¿ô¤ò¤È¤ë¡£ + + $DECODER ¤Ï¥Ð¥¤¥ÈÎó¤ò¤³¤Î¥³¡¼¥É·Ï¤Ë½¾¤Ã¤Æ¥Ç¥³¡¼¥É¤¹¤ë´Ø¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ + ¤³¤Î´Ø¿ô¤Ï°Ê²¼¤Î£´°ú¿ô¤ò¤È¤ë¡£ + + @li ¥Ç¥³¡¼¥É¤¹¤ë¥Ð¥¤¥ÈÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ @li ¥Ç¥³¡¼¥É¤¹¤Ù¤­¥Ð¥¤¥È¿ô @li ¥Ç¥³¡¼¥É·ë²Ì¤Îʸ»ú¤òÉղ乤ë M-text ¤Ø¤Î¥Ý¥¤¥ó¥¿ @li ¥³¥ó¥Ð¡¼¥¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ - $DECODER ¤ÏÀ®¸ù¤·¤¿¤È¤­¤Ë¤Ï0¤ò¡¢¼ºÇÔ¤·¤¿¤È¤­¤Ë¤Ï-1¤òÊÖ¤µ¤Ê¤¯¤Æ¤Ï¤Ê - ¤é¤Ê¤¤¡£ + $DECODER ¤ÏÀ®¸ù¤·¤¿¤È¤­¤Ë¤Ï 0 ¤ò¡¢¼ºÇÔ¤·¤¿¤È¤­¤Ë¤Ï -1 + ¤òÊÖ¤µ¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ - $ENCODER ¤Ï M-text ¤ò¤³¤Î¥³¡¼¥É·Ï¤Ë½¾¤Ã¤Æ¥¨¥ó¥³¡¼¥É¤¹ - ¤ë´Ø¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¤³¤Î´Ø¿ô¤Ï°Ê²¼¤Î6°ú¿ô¤ò¤È¤ë¡£ + $ENCODER ¤Ï M-text ¤ò¤³¤Î¥³¡¼¥É·Ï¤Ë½¾¤Ã¤Æ¥¨¥ó¥³¡¼¥É¤¹¤ë´Ø¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ + ¤³¤Î´Ø¿ô¤Ï°Ê²¼¤Î£¶°ú¿ô¤ò¤È¤ë¡£ - @li M-text ¤Ø¤Î¥Ý¥¤¥ó¥¿ + @li ¥¨¥ó¥³¡¼¥É¤¹¤ëM-text ¤Ø¤Î¥Ý¥¤¥ó¥¿ @li M-text ¤Î¥¨¥ó¥³¡¼¥É³«»Ï°ÌÃÖ @li M-text ¤Î¥¨¥ó¥³¡¼¥É½ªÎ»°ÌÃÖ @li À¸À®¤·¤¿¥Ð¥¤¥È¤òÊÝ»ý¤¹¤ë¥á¥â¥êÎΰè¤Ø¤Î¥Ý¥¤¥ó¥¿ @li ¥á¥â¥êÎΰè¤Î¥µ¥¤¥º @li ¥³¥ó¥Ð¡¼¥¿¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ - $ENCODER ¤ÏÀ®¸ù¤·¤¿¤È¤­¤Ë¤Ï0¤ò¡¢¼ºÇÔ¤·¤¿¤È¤­¤Ë¤Ï-1¤òÊÖ¤µ¤Ê¤¯¤Æ¤Ï¤Ê - ¤é¤Ê¤¤¡£ - - $EXTRA_INFO ¤Ï¥³¡¼¥Ç¥£¥°¥·¥¹¥Æ¥à¤Ë´Ø¤¹¤ëÄɲþðÊó¤ò´Þ¤à¥Ç¡¼¥¿¹½Â¤¤Ø - ¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¤³¤Î¥Ç¡¼¥¿¹½Â¤¤Î¥¿¥¤¥×¤Ï $TYPE ¤Ë°Í¸¤¹¤ë¡£ - - $TYPE ¤¬ #MCODING_TYPE_ISO_2022 ¤Ç¤¢¤ì¤Ð¡¢$EXTRA_INFO ¤Ï @c - MCodingInfoISO2022 ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + $ENCODER ¤ÏÀ®¸ù¤·¤¿¤È¤­¤Ë¤Ï 0 ¤ò¡¢¼ºÇÔ¤·¤¿¤È¤­¤Ë¤Ï -1 + ¤òÊÖ¤µ¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ - $TYPE ¤¬ #MCODING_TYPE_UTF ¤Ç¤¢¤ì¤Ð¡¢$EXTRA_INFO ¤Ï @c - MCodingInfoUTF ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ - - $TYPE ¤¬ #MCODING_TYPE_CHARSET, #MCODING_TYPE_MISC ¤Î¤É¤ì¤«¤Ç - ¤¢¤ì¤Ð¡¢$EXTRA_INFO ¤Ï̵»ë¤µ¤ì¤ë¡£ + $EXTRA_INFO ¤Ï¥³¡¼¥Ç¥£¥°¥·¥¹¥Æ¥à¤Ë´Ø¤¹¤ëÄɲþðÊó¤ò´Þ¤à¥Ç¡¼¥¿¹½Â¤¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ + ¤³¤Î¥Ç¡¼¥¿¹½Â¤¤Î·¿ $TYPE ¤Ë°Í¸¤¹¤ë¡£ @return - ½èÍý¤ËÀ®¸ù¤¹¤ì¤Ð mconv_define_coding () ¤Ï $NAME ¤È¤¤¤¦Ì¾Á°¤Î¥· - ¥ó¥Ü¥ë¤òÊÖ¤¹¡£¤³¤Î¥·¥ó¥Ü¥ë¤Ï¡¢¥­¡¼¤¬ $Mcoding ¤Ç¡¢ºî¤é¤ì¤¿¥³¡¼¥É·Ï - ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÃͤȤ¹¤ë¥·¥ó¥Ü¥ë¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£ ¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì - ¤¿¾ì¹ç¤Ï Mnil ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ + ½èÍý¤ËÀ®¸ù¤¹¤ì¤Ð mconv_define_coding () ¤Ï $NAME + ¤È¤¤¤¦Ì¾Á°¤Î¥·¥ó¥Ü¥ë¤òÊÖ¤¹¡£ ¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï #Mnil + ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */ /*** @@ -3594,9 +3769,9 @@ MSymbol Mcoding; @c MERROR_CODING */ MSymbol -mconv_define_coding (char *name, MPlist *plist, +mconv_define_coding (const char *name, MPlist *plist, int (*resetter) (MConverter *), - int (*decoder) (unsigned char *, int, MText *, + int (*decoder) (const unsigned char *, int, MText *, MConverter *), int (*encoder) (MText *, int, int, unsigned char *, int, @@ -3802,7 +3977,15 @@ mconv_define_coding (char *name, MPlist *plist, The mconv_resolve_coding () function returns $SYMBOL if it represents a coding system. Otherwise, canonicalize $SYMBOL as to a coding system name, and if the canonicalized name represents a - coding system, return it. Otherwise, return Mnil. */ + coding system, return it. Otherwise, return #Mnil. */ +/***ja + @brief ¥³¡¼¥É·Ï¤Î̾Á°¤ò²ò·è¤¹¤ë. + + ´Ø¿ô mconv_resolve_coding () ¤Ï $SYMBOL ¤¬¥³¡¼¥É·Ï¤ò¼¨¤·¤Æ¤¤¤ì¤Ð¤½¤ì¤òÊÖ¤¹¡£ + ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥³¡¼¥É·Ï¤Î̾Á°¤È¤·¤Æ $SYMBOL + ¤òÀµµ¬²½¤·¡¢¤½¤ì¤¬¥³¡¼¥É·Ï¤òɽ¤·¤Æ¤¤¤ì¤ÐÀµµ¬²½¤·¤¿ $SYMBOL ¤òÊÖ¤¹¡£ + ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð#Mnil ¤òÊÖ¤¹¡£ */ + MSymbol @@ -3822,11 +4005,16 @@ mconv_resolve_coding (MSymbol symbol) /***en - @brief List symbols representing a coding system. + @brief List symbols representing coding systems. The mconv_list_codings () function makes an array of symbols representing a coding system, stores the pointer to the array in a place pointed to by $SYMBOLS, and returns the length of the array. */ +/***ja + @brief ¥³¡¼¥É·Ï¤òɽ¤ï¤¹¥·¥ó¥Ü¥ë¤òÎóµó¤¹¤ë. + + ´Ø¿ô mchar_list_codings () ¤Ï¡¢¥³¡¼¥É·Ï¤ò¼¨¤¹¥·¥ó¥Ü¥ë¤òʤ٤¿ÇÛÎó¤òºî¤ê¡¢ + $SYMBOLS ¤Ç¥Ý¥¤¥ó¥È¤µ¤ì¤¿¾ì½ê¤Ë¤³¤ÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÃÖ¤­¡¢ÇÛÎó¤ÎŤµ¤òÊÖ¤¹¡£ */ int mconv_list_codings (MSymbol **symbols) @@ -3838,7 +4026,10 @@ mconv_list_codings (MSymbol **symbols) MTABLE_MALLOC ((*symbols), i, MERROR_CODING); i = 0; MPLIST_DO (plist, coding_definition_list) - (*symbols)[i++] = MPLIST_KEY (plist); + { + MPlist *pl = MPLIST_VAL (plist); + (*symbols)[i++] = MPLIST_SYMBOL (pl); + } for (j = 0; j < coding_list.used; j++) if (! mplist_find_by_key (coding_definition_list, coding_list.codings[j]->name)) @@ -3852,11 +4043,11 @@ mconv_list_codings (MSymbol **symbols) @brief Create a code converter bound to a buffer. The mconv_buffer_converter () function creates a pointer to a code - converter for coding system $CODING. The code converter is bound + converter for coding system $NAME. The code converter is bound to buffer area of $N bytes pointed to by $BUF. Subsequent decodings and encodings are done to/from this buffer area. - $CODING can be #Mnil. In this case, a coding system associated + $NAME can be #Mnil. In this case, a coding system associated with the current locale (LC_CTYPE) is used. @return @@ -3865,19 +4056,19 @@ mconv_list_codings (MSymbol **symbols) assigns an error code to the external variable #merror_code. */ /***ja - @brief ¥Ð¥Ã¥Õ¥¡¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤òºî¤ë + @brief ¥Ð¥Ã¥Õ¥¡¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤òºî¤ë. - ´Ø¿ô mconv_buffer_converter () ¤Ï¡¢¥³¡¼¥É·Ï $CODING ÍѤΥ³¡¼¥É¥³¥ó - ¥Ð¡¼¥¿¤òºî¤ë¡£¤³¤Î¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤Ï¡¢$BUF ¤Ç¼¨¤µ¤ì¤ëÂ礭¤µ $N ¥Ð - ¥¤¥È¤Î¥Ð¥Ã¥Õ¥¡Îΰè¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤ë¡£¤³¤ì°Ê¹ß¤Î¥Ç¥³¡¼¥É¤ª¤è¤Ó - ¥¨¥ó¥³¡¼¥É¤Ï¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡Îΰè¤ËÂФ·¤Æ¹Ô¤Ê¤ï¤ì¤ë¡£ + ´Ø¿ô mconv_buffer_converter () ¤Ï¡¢¥³¡¼¥É·Ï $NAME + ÍѤΥ³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤òºî¤ë¡£¤³¤Î¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤Ï¡¢$BUF ¤Ç¼¨¤µ¤ì¤ëÂ礭¤µ $N + ¥Ð¥¤¥È¤Î¥Ð¥Ã¥Õ¥¡Îΰè¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤ë¡£ + ¤³¤ì°Ê¹ß¤Î¥Ç¥³¡¼¥É¤ª¤è¤Ó¥¨¥ó¥³¡¼¥É¤Ï¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡Îΰè¤ËÂФ·¤Æ¹Ô¤Ê¤ï¤ì¤ë¡£ - $CODING ¤Ï #Mnil ¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¡£¤³¤Î¾ì¹ç¤Ï¸½ºß¤Î¥í¥±¡¼¥ë + $NAME ¤Ï #Mnil ¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¡£¤³¤Î¾ì¹ç¤Ï¸½ºß¤Î¥í¥±¡¼¥ë (LC_CTYPE) ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥³¡¼¥É·Ï¤¬»È¤ï¤ì¤ë¡£ @return - ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð mconv_buffer_converter () ¤Ï ºî¤é¤ì¤¿¥³¡¼¥É¥³ - ¥ó¥Ð¡¼¥¿¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code + ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð mconv_buffer_converter () ¤Ï ºîÀ®¤·¤¿¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤òÊÖ¤¹¡£ + ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ @latexonly \IPAlabel{mconverter} @endlatexonly */ @@ -3929,34 +4120,34 @@ mconv_buffer_converter (MSymbol name, unsigned char *buf, int n) /***en @brief Create a code converter bound to a stream. - The mconv_stream_converter () function create a pointer to a code - converter for coding system $CODING. The code converter is bound + The mconv_stream_converter () function creates a pointer to a code + converter for coding system $NAME. The code converter is bound to stream $FP. Subsequent decodings and encodings are done to/from this stream. - $CODING can be #Mnil. In this case, a coding system associated + $NAME can be #Mnil. In this case, a coding system associated with the current locale (LC_CTYPE) is used. @return If the operation was successful, mconv_stream_converter () returns the created code converter. Otherwise it returns @c NULL - and assigns an error code to the external variable @c - merror_code. */ + and assigns an error code to the external variable + #merror_code. */ /***ja - @brief ¥¹¥È¥ê¡¼¥à¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤òºî¤ë + @brief ¥¹¥È¥ê¡¼¥à¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤òºî¤ë. - ´Ø¿ô mconv_stream_converter () ¤Ï¡¢¥³¡¼¥É·Ï $CODING ÍѤΥ³¡¼¥É¥³¥ó - ¥Ð¡¼¥¿¤òºî¤ë¡£¤³¤Î¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤Ï¡¢¥¹¥È¥ê¡¼¥à $FP ¤Ë·ë¤ÓÉÕ¤±¤é - ¤ì¤ë¡£¤³¤ì°Ê¹ß¤Î¥Ç¥³¡¼¥É¤ª¤è¤Ó¥¨¥ó¥³¡¼¥É¤Ï¡¢¤³¤Î¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ - ¹Ô¤Ê¤ï¤ì¤ë¡£ + ´Ø¿ô mconv_stream_converter () ¤Ï¡¢¥³¡¼¥É·Ï $NAME + ÍѤΥ³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤òºî¤ë¡£¤³¤Î¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤Ï¡¢¥¹¥È¥ê¡¼¥à $FP + ¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤ë¡£ + ¤³¤ì°Ê¹ß¤Î¥Ç¥³¡¼¥É¤ª¤è¤Ó¥¨¥ó¥³¡¼¥É¤Ï¡¢¤³¤Î¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¹Ô¤Ê¤ï¤ì¤ë¡£ - $CODING ¤Ï #Mnil ¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¡£¤³¤Î¾ì¹ç¤Ï¸½ºß¤Î¥í¥±¡¼¥ë + $NAME ¤Ï #Mnil ¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¡£¤³¤Î¾ì¹ç¤Ï¸½ºß¤Î¥í¥±¡¼¥ë (LC_CTYPE) ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥³¡¼¥É·Ï¤¬»È¤ï¤ì¤ë¡£ - @return - ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_stream_converter () ¤Ïºî¤é¤ì¤¿¥³¡¼¥É¥³ - ¥ó¥Ð¡¼¥¿¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code - ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ + @return + ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_stream_converter () + ¤ÏºîÀ®¤·¤¿¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @c NULL + ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ @latexonly \IPAlabel{mconverter} @endlatexonly */ @@ -4026,15 +4217,15 @@ mconv_stream_converter (MSymbol name, FILE *fp) applied to $CONVERTER. Otherwise it returns 0. */ /***ja - @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ò¥ê¥»¥Ã¥È¤¹¤ë + @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ò¥ê¥»¥Ã¥È¤¹¤ë. - ´Ø¿ô mconv_reset_converter () ¤Ï¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER ¤ò½é´ü - ¾õÂÖ¤ËÌ᤹¡£ + ´Ø¿ô mconv_reset_converter () ¤Ï¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER + ¤ò½é´ü¾õÂÖ¤ËÌ᤹¡£ @return ¤â¤· $CONVERTER->coding ¤Ë¥ê¥»¥Ã¥ÈÍѤδؿô¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢ - mconv_reset_converter () ¤Ï¤½¤Î´Ø¿ô¤Ë $CONVERTER ¤òŬÍѤ·¤¿·ë²Ì¤ò - ÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð0¤òÊÖ¤¹¡£ */ + mconv_reset_converter () ¤Ï¤½¤Î´Ø¿ô¤Ë $CONVERTER + ¤òŬÍѤ·¤¿·ë²Ì¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð0¤òÊÖ¤¹¡£ */ int mconv_reset_converter (MConverter *converter) @@ -4059,10 +4250,10 @@ mconv_reset_converter (MConverter *converter) $CONVERTER. */ /***ja - @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ò²òÊü¤¹¤ë + @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ò²òÊü¤¹¤ë. - ´Ø¿ô mconv_free_converter () ¤Ï¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER ¤ò²òÊü - ¤¹¤ë¡£ */ + ´Ø¿ô mconv_free_converter () ¤Ï¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER + ¤ò²òÊü¤¹¤ë¡£ */ void mconv_free_converter (MConverter *converter) @@ -4089,12 +4280,11 @@ mconv_free_converter (MConverter *converter) This function always returns $CONVERTER. */ /***ja - @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤Ë¥Ð¥Ã¥Õ¥¡Îΰè¤ò·ë¤ÓÉÕ¤±¤ë + @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤Ë¥Ð¥Ã¥Õ¥¡Îΰè¤ò·ë¤ÓÉÕ¤±¤ë. - ´Ø¿ô mconv_rebind_buffer () ¤Ï¡¢$BUF ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤¿Â礭¤µ $N ¥Ð - ¥¤¥È¤Î¥Ð¥Ã¥Õ¥¡Îΰè¤ò¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER ¤Ë·ë¤ÓÉÕ¤±¤ë¡£¤³¤ì - °Ê¹ß¤Î¥Ç¥³¡¼¥É¤ª¤è¤Ó¥¨¥ó¥³¡¼¥É¤Ï¡¢¤³¤Î¿·¤¿¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡ - Îΰè¤ËÂФ·¤Æ¹Ô¤Ê¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + ´Ø¿ô mconv_rebind_buffer () ¤Ï¡¢$BUF ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤¿Â礭¤µ $N + ¥Ð¥¤¥È¤Î¥Ð¥Ã¥Õ¥¡Îΰè¤ò¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER ¤Ë·ë¤ÓÉÕ¤±¤ë¡£ + ¤³¤ì°Ê¹ß¤Î¥Ç¥³¡¼¥É¤ª¤è¤Ó¥¨¥ó¥³¡¼¥É¤Ï¡¢¤³¤Î¿·¤¿¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡Îΰè¤ËÂФ·¤Æ¹Ô¤Ê¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ @return ¤³¤Î´Ø¿ô¤Ï¾ï¤Ë $CONVERTER ¤òÊÖ¤¹¡£ @@ -4130,11 +4320,11 @@ mconv_rebind_buffer (MConverter *converter, unsigned char *buf, int n) This function always returns $CONVERTER. */ /***ja - @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤Ë¥¹¥È¥ê¡¼¥à¤ò·ë¤ÓÉÕ¤±¤ë + @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤Ë¥¹¥È¥ê¡¼¥à¤ò·ë¤ÓÉÕ¤±¤ë. ´Ø¿ô mconv_rebind_stream () ¤Ï¡¢¥¹¥È¥ê¡¼¥à $FP ¤ò¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ - $CONVERTER ¤Ë·ë¤ÓÉÕ¤±¤ë¡£¤³¤ì°Ê¹ß¤Î¥Ç¥³¡¼¥É¤ª¤è¤Ó¥¨¥ó¥³¡¼¥É¤Ï¡¢ - ¤³¤Î¿·¤¿¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¹Ô¤Ê¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ + $CONVERTER ¤Ë·ë¤ÓÉÕ¤±¤ë¡£ + ¤³¤ì°Ê¹ß¤Î¥Ç¥³¡¼¥É¤ª¤è¤Ó¥¨¥ó¥³¡¼¥É¤Ï¡¢¤³¤Î¿·¤¿¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¹Ô¤Ê¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ @return ¤³¤Î´Ø¿ô¤Ï¾ï¤Ë $CONVERTER ¤òÊÖ¤¹¡£ @@ -4170,7 +4360,8 @@ mconv_rebind_stream (MConverter *converter, FILE *fp) The mconv_decode () function decodes a byte sequence and appends the result at the end of M-text $MT. The source byte sequence is - taken from currently bound the buffer area or the stream. + taken from either the buffer area or the stream that is currently + bound to $CONVERTER. @return If the operation was successful, mconv_decode () returns updated @@ -4178,16 +4369,16 @@ mconv_rebind_stream (MConverter *converter, FILE *fp) the external variable #merror_code. */ /***ja - @brief ¥Ð¥¤¥ÈÎó¤ò M-text ¤Ë¥Ç¥³¡¼¥É¤¹¤ë + @brief ¥Ð¥¤¥ÈÎó¤ò M-text ¤Ë¥Ç¥³¡¼¥É¤¹¤ë. ´Ø¿ô mconv_decode () ¤Ï¡¢¥Ð¥¤¥ÈÎó¤ò¥Ç¥³¡¼¥É¤·¤Æ¤½¤Î·ë²Ì¤ò M-text - $MT ¤ÎËöÈø¤ËÄɲ乤롣¥Ç¥³¡¼¥É¸µ¤Î¥Ð¥¤¥ÈÎó¤Ï¡¢¸½ºß·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤¤¤ë - ¥Ð¥Ã¥Õ¥¡Îΰ褢¤ë¤¤¤Ï¥¹¥È¥ê¡¼¥à¤«¤é¼è¤é¤ì¤ë¡£ + $MT ¤ÎËöÈø¤ËÄɲ乤롣¥Ç¥³¡¼¥É¸µ¤Î¥Ð¥¤¥ÈÎó¤Ï¡¢$CONVERTER + ¤Ë¸½ºß·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡Îΰ褢¤ë¤¤¤Ï¥¹¥È¥ê¡¼¥à¤«¤é¼è¤é¤ì¤ë¡£ @return - ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_decode () ¤Ï¹¹¿·¤µ¤ì¤¿ $MT ¤òÊÖ¤¹¡£¤½ - ¤¦¤Ç¤Ê¤±¤ì¤Ð @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤ò - ÀßÄꤹ¤ë¡£ */ + ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_decode () ¤Ï¹¹¿·¤µ¤ì¤¿ $MT ¤òÊÖ¤¹¡£ + ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code + ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */ /*** @errors @@ -4207,6 +4398,9 @@ mconv_decode (MConverter *converter, MText *mt) M_CHECK_READONLY (mt, NULL); + if (mt->format != MTEXT_FORMAT_UTF_8) + mtext__adjust_format (mt, MTEXT_FORMAT_UTF_8); + if (! mt->data) mtext__enlarge (mt, MAX_UTF8_CHAR_BYTES); @@ -4306,27 +4500,27 @@ mconv_decode (MConverter *converter, MText *mt) /***en @brief Decode a buffer area based on a coding system. - The mconv_decode_buffer () function decodes $N bytes of buffer + The mconv_decode_buffer () function decodes $N bytes of the buffer area pointed to by $BUF based on the coding system $NAME. A temporary code converter for decoding is automatically created and freed. - @return - If the operation was successful, mconv_decode_buffer () returns - the resulting M-text. Otherwise it returns NULL and assigns an - error code to the external variable #merror_code. */ + @return + If the operation was successful, mconv_decode_buffer () + returns the resulting M-text. Otherwise it returns @c NULL and + assigns an error code to the external variable #merror_code. */ /***ja - @brief ¥³¡¼¥É·Ï¤Ë´ð¤Å¤¤¤Æ¥Ð¥Ã¥Õ¥¡Îΰè¤ò¥Ç¥³¡¼¥É¤¹¤ë + @brief ¥³¡¼¥É·Ï¤Ë´ð¤Å¤¤¤Æ¥Ð¥Ã¥Õ¥¡Îΰè¤ò¥Ç¥³¡¼¥É¤¹¤ë. - ´Ø¿ô mconv_decode_buffer () ¤Ï¡¢$BUF ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤¿ $N ¥Ð¥¤¥È¤Î - ¥Ð¥Ã¥Õ¥¡Îΰè¤ò¡¢¥³¡¼¥É·Ï $NAME ¤Ë´ð¤Å¤¤¤Æ¥Ç¥³¡¼¥É¤¹¤ë¡£¥Ç¥³¡¼¥É¤Ë - ɬÍפʥ³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ÎºîÀ®¤È²òÊü¤Ï¼«Æ°Åª¤Ë¹Ô¤Ê¤ï¤ì¤ë¡£ + ´Ø¿ô mconv_decode_buffer () ¤Ï¡¢$BUF ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤¿ $N + ¥Ð¥¤¥È¤Î¥Ð¥Ã¥Õ¥¡Îΰè¤ò¡¢¥³¡¼¥É·Ï $NAME ¤Ë´ð¤Å¤¤¤Æ¥Ç¥³¡¼¥É¤¹¤ë¡£ + ¥Ç¥³¡¼¥É¤ËɬÍפʥ³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ÎºîÀ®¤È²òÊü¤Ï¼«Æ°Åª¤Ë¹Ô¤Ê¤ï¤ì¤ë¡£ @return - ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_decode_buffer () ¤ÏÆÀ¤é¤ì¤¿ M-text ¤ò - ÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼ - ¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */ + ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_decode_buffer () ¤ÏÆÀ¤é¤ì¤¿ M-text ¤òÊÖ¤¹¡£ + ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code + ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */ /*** @errors @@ -4364,20 +4558,20 @@ mconv_decode_buffer (MSymbol name, unsigned char *buf, int n) @return If the operation was successful, mconv_decode_stream () returns - the resulting M-text. Otherwise it returns NULL and assigns an + the resulting M-text. Otherwise it returns @c NULL and assigns an error code to the external variable #merror_code. */ /***ja - @brief ¥³¡¼¥É·Ï¤Ë´ð¤Å¤¤¤Æ¥¹¥È¥ê¡¼¥àÆþÎϤò¥Ç¥³¡¼¥É¤¹¤ë + @brief ¥³¡¼¥É·Ï¤Ë´ð¤Å¤¤¤Æ¥¹¥È¥ê¡¼¥àÆþÎϤò¥Ç¥³¡¼¥É¤¹¤ë. - ´Ø¿ô mconv_decode_stream () ¤Ï¡¢¥¹¥È¥ê¡¼¥à $FP ¤«¤éÆɤ߹þ¤Þ¤ì¤ë¥Ð - ¥¤¥ÈÎóÁ´ÂΤò¡¢¥³¡¼¥É·Ï $NAME ¤Ë´ð¤Å¤¤¤Æ¥Ç¥³¡¼¥É¤¹¤ë¡£¥Ç¥³¡¼¥É¤Ëɬ - Íפʥ³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ÎºîÀ®¤È²òÊü¤Ï¼«Æ°Åª¤Ë¹Ô¤Ê¤ï¤ì¤ë¡£ + ´Ø¿ô mconv_decode_stream () ¤Ï¡¢¥¹¥È¥ê¡¼¥à $FP + ¤«¤éÆɤ߹þ¤Þ¤ì¤ë¥Ð¥¤¥ÈÎóÁ´ÂΤò¡¢¥³¡¼¥É·Ï $NAME + ¤Ë´ð¤Å¤¤¤Æ¥Ç¥³¡¼¥É¤¹¤ë¡£¥Ç¥³¡¼¥É¤ËɬÍפʥ³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ÎºîÀ®¤È²òÊü¤Ï¼«Æ°Åª¤Ë¹Ô¤Ê¤ï¤ì¤ë¡£ @return - ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_decode_stream () ¤ÏÆÀ¤é¤ì¤¿ M-text ¤òÊÖ - ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼ - ¥É¤òÀßÄꤹ¤ë¡£ */ + ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_decode_stream () ¤ÏÆÀ¤é¤ì¤¿ M-text + ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @c NULL ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code + ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */ /*** @errors @@ -4418,16 +4612,15 @@ mconv_decode_stream (MSymbol name, FILE *fp) error code to the external variable #merror_code. */ /***ja - @brief M-text ¤ò¥Ð¥¤¥ÈÎó¤Ë¥¨¥ó¥³¡¼¥É¤¹¤ë + @brief M-text ¤ò¥Ð¥¤¥ÈÎó¤Ë¥¨¥ó¥³¡¼¥É¤¹¤ë. - ´Ø¿ô mconv_encode () ¤Ï¡¢M-text $MT ¤ò¥¨¥ó¥³¡¼¥É¤·¤Æ¡¢¥³¡¼¥É¥³¥ó¥Ð¡¼ - ¥¿ $CONVERTER ¤Ë¸½ºß·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡Îΰ褢¤ë¤¤¤Ï¥¹¥È¥ê¡¼ - ¥à¤Ë½ñ¤­¹þ¤à¡£ + ´Ø¿ô mconv_encode () ¤Ï¡¢M-text $MT ¤ò¥¨¥ó¥³¡¼¥É¤·¤Æ¡¢¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ + $CONVERTER ¤Ë¸½ºß·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡Îΰ褢¤ë¤¤¤Ï¥¹¥È¥ê¡¼¥à¤ËÆÀ¤é¤ì¤¿¥Ð¥¤¥ÈÎó¤ò½ñ¤­¹þ¤à¡£ @return ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_encode () ¤Ï½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ - ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄê - ¤¹¤ë¡£ */ + ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code + ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */ /*** @errors @@ -4446,7 +4639,7 @@ mconv_encode (MConverter *converter, MText *mt) /*=*/ /***en - @brief Encode a part of an M-text + @brief Encode a part of an M-text. The mconv_encode_range () function encodes the text between $FROM (inclusive) and $TO (exclusive) in M-text $MT and writes the @@ -4459,17 +4652,17 @@ mconv_encode (MConverter *converter, MText *mt) error code to the external variable #merror_code. */ /***ja - @brief M-text ¤Î°ìÉô¤ò¤ò¥Ð¥¤¥ÈÎó¤Ë¥¨¥ó¥³¡¼¥É¤¹¤ë + @brief M-text ¤Î°ìÉô¤ò¥Ð¥¤¥ÈÎó¤Ë¥¨¥ó¥³¡¼¥É¤¹¤ë. - ´Ø¿ô mconv_encode_range () ¤Ï¡¢M-text $MT ¤Î $FROM ¡Ê´Þ¤à¡Ë¤«¤é - $TO ¡Ê´Þ¤Þ¤Ê¤¤¡Ë¤Þ¤Ç¤ÎÈϰϤΥƥ­¥¹¥È¤ò¥¨¥ó¥³¡¼¥É¤·¤Æ¡¢¥³¡¼¥É¥³¥ó¥Ð¡¼ - ¥¿ $CONVERTER ¤Ë¸½ºß·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡Îΰ褢¤ë¤¤¤Ï¥¹¥È¥ê¡¼ - ¥à¤Ë½ñ¤­¹þ¤à¡£ + ´Ø¿ô mconv_encode_range () ¤Ï¡¢M-text $MT ¤Î $FROM + ¡Ê$FROM ¼«ÂΤâ´Þ¤à¡Ë¤«¤é $TO ¡Ê$TO¼«ÂΤϴޤޤʤ¤¡Ë + ¤Þ¤Ç¤ÎÈϰϤΥƥ­¥¹¥È¤ò¥¨¥ó¥³¡¼¥É¤·¤Æ¡¢¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ + $CONVERTER ¤Ë¸½ºß·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡Îΰ褢¤ë¤¤¤Ï¥¹¥È¥ê¡¼¥à¤ËÆÀ¤é¤ì¤¿¥Ð¥¤¥ÈÎó¤ò½ñ¤­¹þ¤à¡£ @return - ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_encode_range () ¤Ï½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô - ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼ - ¥É¤òÀßÄꤹ¤ë¡£ */ + ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_encode_range () + ¤Ï½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð -1 + ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */ /*** @errors @@ -4495,6 +4688,7 @@ mconv_encode_range (MConverter *converter, MText *mt, int from, int to) converter->nchars = converter->nbytes = 0; converter->result = MCONVERSION_RESULT_SUCCESS; + mtext_put_prop (mt, from, to, Mcoding, internal->coding->name); if (internal->binding == BINDING_BUFFER) { (*internal->coding->encoder) (mt, from, to, @@ -4558,17 +4752,16 @@ mconv_encode_range (MConverter *converter, MText *mt, int from, int to) an error code to the external variable #merror_code. */ /***ja - @brief M-text ¤ò¥¨¥ó¥³¡¼¥É¤·¤Æ¥Ð¥Ã¥Õ¥¡Îΰè¤Ë½ñ¤­¹þ¤à + @brief M-text ¤ò¥¨¥ó¥³¡¼¥É¤·¤Æ¥Ð¥Ã¥Õ¥¡Îΰè¤Ë½ñ¤­¹þ¤à. - ´Ø¿ô mconv_encode_buffer () ¤ÏM-text $MT ¤ò¥³¡¼¥É·Ï $NAME ¤Ë´ð¤Å¤¤ - ¤Æ¥¨¥ó¥³¡¼¥É¤·¡¢ÆÀ¤é¤ì¤¿¥Ð¥¤¥ÈÎó¤ò $BUF ¤Î»Ø¤¹¥Ð¥Ã¥Õ¥¡Îΰè¤Ë½ñ¤­¹þ - ¤à¡£$N ¤Ï½ñ¤­¹þ¤àºÇÂç¥Ð¥¤¥È¿ô¤Ç¤¢¤ë¡£¥¨¥ó¥³¡¼¥É¤ËɬÍפʥ³¡¼¥É¥³¥ó - ¥Ð¡¼¥¿¤ÎºîÀ®¤È²òÊü¤Ï¼«Æ°Åª¤Ë¹Ô¤Ê¤ï¤ì¤ë¡£ + ´Ø¿ô mconv_encode_buffer () ¤ÏM-text $MT ¤ò¥³¡¼¥É·Ï $NAME + ¤Ë´ð¤Å¤¤¤Æ¥¨¥ó¥³¡¼¥É¤·¡¢ÆÀ¤é¤ì¤¿¥Ð¥¤¥ÈÎó¤ò $BUF ¤Î»Ø¤¹¥Ð¥Ã¥Õ¥¡Îΰè¤Ë½ñ¤­¹þ¤à¡£ + $N ¤Ï½ñ¤­¹þ¤àºÇÂç¥Ð¥¤¥È¿ô¤Ç¤¢¤ë¡£ + ¥¨¥ó¥³¡¼¥É¤ËɬÍפʥ³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ÎºîÀ®¤È²òÊü¤Ï¼«Æ°Åª¤Ë¹Ô¤Ê¤ï¤ì¤ë¡£ @return - ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_encode_buffer () ¤Ï½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È - ¿ô¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð-1¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼ - ¥É¤òÀßÄꤹ¤ë¡£ */ + ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_encode_buffer () ¤Ï½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£ + ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð-1¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */ /*** @errors @@ -4606,16 +4799,16 @@ mconv_encode_buffer (MSymbol name, MText *mt, unsigned char *buf, int n) an error code to the external variable #merror_code. */ /***ja - @brief M-text ¤ò¥¨¥ó¥³¡¼¥É¤·¤Æ¥¹¥È¥ê¡¼¥à¤Ë½ñ¤­¹þ¤à + @brief M-text ¤ò¥¨¥ó¥³¡¼¥É¤·¤Æ¥¹¥È¥ê¡¼¥à¤Ë½ñ¤­¹þ¤à. - ´Ø¿ô mconv_encode_stream () ¤ÏM-text $MT ¤ò¥³¡¼¥É·Ï $NAME ¤Ë´ð¤Å¤¤ - ¤Æ¥¨¥ó¥³¡¼¥É¤·¡¢ÆÀ¤é¤ì¤¿¥Ð¥¤¥ÈÎó¤ò¥¹¥È¥ê¡¼¥à $FP ¤Ë½ñ¤­½Ð¤¹¡£¥¨¥ó - ¥³¡¼¥É¤ËɬÍפʥ³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ÎºîÀ®¤È²òÊü¤Ï¼«Æ°Åª¤Ë¹Ô¤Ê¤ï¤ì¤ë¡£ + ´Ø¿ô mconv_encode_stream () ¤ÏM-text $MT ¤ò¥³¡¼¥É·Ï $NAME + ¤Ë´ð¤Å¤¤¤Æ¥¨¥ó¥³¡¼¥É¤·¡¢ÆÀ¤é¤ì¤¿¥Ð¥¤¥ÈÎó¤ò¥¹¥È¥ê¡¼¥à $FP + ¤Ë½ñ¤­½Ð¤¹¡£¥¨¥ó¥³¡¼¥É¤ËɬÍפʥ³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ÎºîÀ®¤È²òÊü¤Ï¼«Æ°Åª¤Ë¹Ô¤Ê¤ï¤ì¤ë¡£ @return - ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_encode_stream () ¤Ï½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô - ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð-1¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É - ¤òÀßÄꤹ¤ë¡£ */ + ¤â¤·½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_encode_stream () + ¤Ï½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð -1 + ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */ /*** @errors @@ -4656,18 +4849,18 @@ mconv_encode_stream (MSymbol name, MText *mt, FILE *fp) #merror_code. */ /***ja - @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿·Ðͳ¤Ç1ʸ»úÆɤà + @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿·Ðͳ¤Ç°ìʸ»ú¤òÆɤߤ³¤à. - ´Ø¿ô mconv_getc () ¤Ï¡¢¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER ¤Ë¸½ºß·ë¤ÓÉÕ¤± - ¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡Îΰ褢¤ë¤¤¤Ï¥¹¥È¥ê¡¼¥à¤«¤é1ʸ»ú¤òÆɤ߹þ¤à¡£¥Ð¥¤ - ¥ÈÎó¤Î¥Ç¥³¡¼¥É¤Ë¤Ï $CONVERTER ¤Î¥Ç¥³¡¼¥À¤¬ÍѤ¤¤é¤ì¤ë¡£$CONVERTER - ¤ÎÆâÉô¾õÂÖ¤ÏɬÍפ˱þ¤¸¤Æ¹¹¿·¤µ¤ì¤ë¡£ + ´Ø¿ô mconv_getc () ¤Ï¡¢¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER + ¤Ë¸½ºß·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡Îΰ褢¤ë¤¤¤Ï¥¹¥È¥ê¡¼¥à¤«¤éʸ»ú¤ò°ì¤ÄÆɤ߹þ¤à¡£ + ¥Ð¥¤¥ÈÎó¤Î¥Ç¥³¡¼¥É¤Ë¤Ï $CONVERTER ¤Î¥Ç¥³¡¼¥À¤¬ÍѤ¤¤é¤ì¤ë¡£ + $CONVERTER ¤ÎÆâÉô¾õÂÖ¤ÏɬÍפ˱þ¤¸¤Æ¹¹¿·¤µ¤ì¤ë¡£ @return ½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_getc () ¤ÏÆɤ߹þ¤Þ¤ì¤¿Ê¸»ú¤òÊÖ¤¹¡£ÆþÎϸ»¤¬ - EOF ¤Ë㤷¤¿¾ì¹ç¤Ï¡¢³°ÉôÊÑ¿ô #merror_code ¤òÊѤ¨¤º¤Ë @c EOF ¤òÊÖ¤¹¡£ - ¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï @c EOF ¤òÊÖ¤·¡¢#merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É - ¤òÀßÄꤹ¤ë¡£ */ + EOF ¤Ë㤷¤¿¾ì¹ç¤Ï¡¢³°ÉôÊÑ¿ô #merror_code ¤òÊѤ¨¤º¤Ë @c EOF + ¤òÊÖ¤¹¡£¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï @c EOF ¤òÊÖ¤·¡¢#merror_code + ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */ /*** @errors @@ -4710,13 +4903,13 @@ mconv_getc (MConverter *converter) external variable #merror_code. */ /***ja - @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤Ë1ʸ»úÌ᤹ + @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤Ë°ìʸ»úÌ᤹. - ´Ø¿ô mconv_ungetc () ¤Ï¡¢¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER ¤Ëʸ»ú $C ¤ò - ²¡¤·Ì᤹¡£²¡¤·Ì᤻¤ëʸ»ú¿ô¤ËÀ©¸Â¤Ï¤Ê¤¤¡£¤³¤Î¸å¤Ë mconv_getc () ¤ò - ¸Æ¤Ó½Ð¤¹¤È¡¢ºÇ¸å¤ËÌᤵ¤ì¤¿Ê¸»ú¤¬ºÇ½é¤ËÆɤޤì¤ë¡£²¡¤·Ìᤵ¤ì¤¿Ê¸»ú¤Ï - $CONVERTER ¤ÎÆâÉô¤ËÃߤ¨¤é¤ì¤ë¤À¤±¤Ç¤¢¤ê¡¢¼ÂºÝ¤ËÆþÎϸ»¤Ë½ñ¤­¹þ¤Þ¤ì - ¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£$CONVERTER ¤ÎÆâÉô¾õÂÖ¤ÏɬÍפ˱þ¤¸¤Æ¹¹¿·¤µ¤ì¤ë¡£ + ´Ø¿ô mconv_ungetc () ¤Ï¡¢¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER ¤Ëʸ»ú $C + ¤ò²¡¤·Ì᤹¡£Ìᤵ¤ì¤ëʸ»ú¿ô¤ËÀ©¸Â¤Ï¤Ê¤¤¡£¤³¤Î¸å¤Ç mconv_getc () + ¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¤Ï¡¢ºÇ¸å¤ËÌᤵ¤ì¤¿Ê¸»ú¤¬ºÇ½é¤ËÆɤޤì¤ë¡£Ìᤵ¤ì¤¿Ê¸»ú¤Ï + $CONVERTER ¤ÎÆâÉô¤ËÃߤ¨¤é¤ì¤ë¤À¤±¤Ç¤¢¤ê¡¢¼ÂºÝ¤ËÆþÎϸ»¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ + $CONVERTER ¤ÎÆâÉô¾õÂÖ¤ÏɬÍפ˱þ¤¸¤Æ¹¹¿·¤µ¤ì¤ë¡£ @return ½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_ungetc () ¤Ï $C ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @c @@ -4759,17 +4952,17 @@ mconv_ungetc (MConverter *converter, int c) an error code to the external variable #merror_code. */ /***ja - @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ò·Ðͳ¤Ç1ʸ»ú½ñ¤¯ + @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ò·Ðͳ¤·¤Æ°ìʸ»ú½ñ¤­½Ð¤¹. - ´Ø¿ô mconv_putc () ¤Ï¡¢¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER ¤Ë¸½ºß·ë¤ÓÉÕ¤± - ¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡Îΰ褢¤ë¤¤¤Ï¥¹¥È¥ê¡¼¥à¤Ëʸ»ú $C ¤ò½ñ¤­½Ð¤¹¡£Ê¸»ú - ¤Î¥¨¥ó¥³¡¼¥É¤Ë¤Ï $CONVERTER ¤Î¥¨¥ó¥³¡¼¥À¤¬ÍѤ¤¤é¤ì¤ë¡£¼ÂºÝ¤Ë½ñ¤­½Ð - ¤µ¤ì¤¿¥Ð¥¤¥È¿ô¤Ï¡¢$CONVERTER ¤Î ¥á¥ó¥Ð¡¼ @c nbytes ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£ - $CONVERTER ¤ÎÆâÉô¾õÂÖ¤ÏɬÍפ˱þ¤¸¤Æ¹¹¿·¤µ¤ì¤ë¡£ + ´Ø¿ô mconv_putc () ¤Ï¡¢¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER + ¤Ë¸½ºß·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡Îΰ褢¤ë¤¤¤Ï¥¹¥È¥ê¡¼¥à¤Ëʸ»ú $C + ¤ò½ñ¤­½Ð¤¹¡£Ê¸»ú¤Î¥¨¥ó¥³¡¼¥É¤Ë¤Ï $CONVERTER + ¤Î¥¨¥ó¥³¡¼¥À¤¬ÍѤ¤¤é¤ì¤ë¡£¼ÂºÝ¤Ë½ñ¤­½Ð¤µ¤ì¤¿¥Ð¥¤¥È¿ô¤Ï¡¢$CONVERTER ¤Î¥á¥ó¥Ð¡¼ + @c nbytes ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£$CONVERTER ¤ÎÆâÉô¾õÂÖ¤ÏɬÍפ˱þ¤¸¤Æ¹¹¿·¤µ¤ì¤ë¡£ @return - ½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_putc () ¤Ï $C ¤òÊÖ¤¹¡£¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç - ¤Ï @c EOF ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */ + ½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_putc () ¤Ï $C ¤òÊÖ¤¹¡£¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï + @c EOF ¤òÊÖ¤·¡¢³°ÉôÊÑ¿ô #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */ /*** @errors @@ -4808,23 +5001,24 @@ mconv_putc (MConverter *converter, int c) If the operation was successful, mconv_gets () returns the modified $MT. If it encounters EOF without reading a single character, it returns $MT without changing it. If an error is - detected, it returns @c NULL and assigns an error code to @c - merror_code. */ + detected, it returns @c NULL and assigns an error code to + #merror_code. */ /***ja - @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ò»È¤Ã¤Æ1¹ÔÆɤà + @brief ¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿¤ò»È¤Ã¤Æ°ì¹ÔÆɤ߹þ¤à. - ´Ø¿ô mconv_gets () ¤Ï¡¢¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER ¤Ë¸½ºß·ë¤ÓÉÕ¤± - ¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡Îΰ褢¤ë¤¤¤Ï¥¹¥È¥ê¡¼¥à¤«¤é1¹Ô¤òÆɤ߹þ¤à¡£¥Ð¥¤¥È - Îó¤Î¥Ç¥³¡¼¥É¤Ë¤Ï $CONVERTER ¤Î¥Ç¥³¡¼¥À¤¬ÍѤ¤¤é¤ì¤ë¡£¥Ç¥³¡¼¥É¤µ¤ì¤¿ - ʸ»úÎó¤Ï M-text $MT ¤ÎËöÈø¤ËÄɲ䵤ì¤ë¡£¸µ¤Î¥Ð¥¤¥ÈÎó¤Î½ªÃ¼²þ¹Ôʸ»ú - ¤ÏÄɲ䵤ì¤Ê¤¤¡£$CONVERTER ¤ÎÆâÉô¾õÂÖ¤ÏɬÍפ˱þ¤¸¤Æ¹¹¿·¤µ¤ì¤ë¡£ + ´Ø¿ô mconv_gets () ¤Ï¡¢¥³¡¼¥É¥³¥ó¥Ð¡¼¥¿ $CONVERTER + ¤Ë¸½ºß·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡Îΰ褢¤ë¤¤¤Ï¥¹¥È¥ê¡¼¥à¤«¤é 1 ¹Ô¤òÆɤ߹þ¤à¡£ + ¥Ð¥¤¥ÈÎó¤Î¥Ç¥³¡¼¥É¤Ë¤Ï $CONVERTER + ¤Î¥Ç¥³¡¼¥À¤¬ÍѤ¤¤é¤ì¤ë¡£¥Ç¥³¡¼¥É¤µ¤ì¤¿Ê¸»úÎó¤Ï M-text $MT + ¤ÎËöÈø¤ËÄɲ䵤ì¤ë¡£¸µ¤Î¥Ð¥¤¥ÈÎó¤Î½ªÃ¼²þ¹Ôʸ»ú¤ÏÄɲ䵤ì¤Ê¤¤¡£ + $CONVERTER ¤ÎÆâÉô¾õÂÖ¤ÏɬÍפ˱þ¤¸¤Æ¹¹¿·¤µ¤ì¤ë¡£ @return - ½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_gets () ¤ÏÊѹ¹¤µ¤ì¤¿ $MT ¤òÊÖ¤¹¡£¤â¤·1ʸ»ú - ¤âÆɤޤº¤Ë EOF ¤ËÅö¤¿¤Ã¤¿¾ì¹ç¤Ï¡¢$MT ¤òÊѹ¹¤»¤º¤Ë¤½¤Î¤Þ¤ÞÊÖ¤¹¡£¥¨ - ¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï @c NULL ¤òÊÖ¤·¡¢#merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤ò - ÀßÄꤹ¤ë¡£ */ + ½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢mconv_gets () ¤ÏÊѹ¹¤µ¤ì¤¿ $MT + ¤òÊÖ¤¹¡£¤â¤·1ʸ»ú¤âÆɤޤº¤Ë EOF ¤ËÁø¶ø¤·¤¿¾ì¹ç¤Ï¡¢$MT + ¤òÊѹ¹¤»¤º¤Ë¤½¤Î¤Þ¤ÞÊÖ¤¹¡£¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤¿¾ì¹ç¤Ï @c NULL ¤òÊÖ¤·¡¢ + #merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */ /*** @errors @@ -4839,6 +5033,9 @@ mconv_gets (MConverter *converter, MText *mt) int c; M_CHECK_READONLY (mt, NULL); + if (mt->format != MTEXT_FORMAT_UTF_8) + mtext__adjust_format (mt, MTEXT_FORMAT_UTF_8); + while (1) { c = mconv_getc (converter); @@ -4847,7 +5044,7 @@ mconv_gets (MConverter *converter, MText *mt) mtext_cat_char (mt, c); } if (c == EOF && converter->result != MCONVERSION_RESULT_SUCCESS) - /* mconv_getc () sets merror_code */ + /* mconv_getc () sets #merror_code */ return NULL; return mt; }