X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fcoding.c;h=2832310c8ed5dc3991739f2489e164c26a0dd615;hb=3456d9ce9577f5a994f70640f6f0273f0b4d3b97;hp=eb7cc9556260b7e6baf7e45cc014fd88d0374565;hpb=b403579aa1e9704ab35659e856dde8582cb4c3f1;p=m17n%2Fm17n-lib.git diff --git a/src/coding.c b/src/coding.c index eb7cc95..2832310 100644 --- a/src/coding.c +++ b/src/coding.c @@ -1,5 +1,5 @@ /* coding.c -- code conversion module. - Copyright (C) 2003, 2004 + Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010 National Institute of Advanced Industrial Science and Technology (AIST) Registration Number H15PRO112 @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with the m17n library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 02111-1307, USA. */ /***en @@ -35,22 +35,21 @@ coding system into an M-text, and inversely, can encode an M-text into a byte sequence. */ -/***oldja +/***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, @@ -156,7 +155,10 @@ typedef struct { Beginning of the byte sequence bound to this converter. */ /**ja ¤³¤Î¥³¥ó¥Ð¡¼¥¿¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤¿¥Ð¥¤¥ÈÎó¤ÎÀèƬ°ÌÃÖ */ - unsigned char *buf; + union { + const unsigned char *in; + unsigned char *out; + } buf; /**en Size of buf. */ @@ -391,8 +393,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; @@ -421,7 +423,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; @@ -512,15 +514,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; @@ -713,15 +715,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; @@ -922,14 +924,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; @@ -1026,14 +1028,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; @@ -1525,15 +1527,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; @@ -1752,8 +1754,10 @@ decode_coding_iso_2022 (unsigned char *source, int src_bytes, MText *mt, else goto invalid_byte; /* We must update these variables now. */ - charset0 = status->designation[status->invocation[0]]; - charset1 = status->designation[status->invocation[1]]; + if (status->invocation[0] >= 0) + charset0 = status->designation[status->invocation[0]]; + if (status->invocation[1] >= 0) + charset1 = status->designation[status->invocation[1]]; continue; case 'n': /* invocation of locking-shift-2 */ @@ -1832,7 +1836,7 @@ decode_coding_iso_2022 (unsigned char *source, int src_bytes, MText *mt, int bytes; int i; - if (! spec->flags & MCODING_ISO_DESIGNATION_CTEXT_EXT) + if (! (spec->flags & MCODING_ISO_DESIGNATION_CTEXT_EXT)) goto invalid_byte; /* Compound-text uses these escape sequences: @@ -1905,8 +1909,10 @@ decode_coding_iso_2022 (unsigned char *source, int src_bytes, MText *mt, else goto invalid_byte; /* We must update these variables now. */ - charset0 = status->designation[status->invocation[0]]; - charset1 = status->designation[status->invocation[1]]; + if (status->invocation[0] >= 0) + charset0 = status->designation[status->invocation[0]]; + if (status->invocation[1] >= 0) + charset1 = status->designation[status->invocation[1]]; continue; unused_escape_sequence: @@ -2635,7 +2641,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; @@ -2646,15 +2652,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; @@ -2819,14 +2825,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; } @@ -2965,6 +2976,9 @@ mcoding__init (void) NULL, NULL, NULL, NULL); mplist_put (param, Mtype, Mnil); + pl = mplist (); + mplist_add (pl, Msymbol, msymbol ("Shift_JIS")); + mplist_put (param, Maliases, pl); mplist_set (charsets, Msymbol, Mcharset_ascii); Mcoding_sjis = mconv_define_coding ("sjis", param, reset_coding_sjis, @@ -2973,6 +2987,7 @@ mcoding__init (void) M17N_OBJECT_UNREF (charsets); M17N_OBJECT_UNREF (param); + M17N_OBJECT_UNREF (pl); return 0; } @@ -3004,31 +3019,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); } } @@ -3040,13 +3043,13 @@ mcoding__load_from_database () MDatabase *mdb = mdatabase_find (msymbol ("coding-list"), Mnil, Mnil, Mnil); MPlist *def_list, *plist; MPlist *definitions = coding_definition_list; - int mdebug_mask = MDEBUG_CODING; + int mdebug_flag = MDEBUG_CODING; if (! mdb) return 0; MDEBUG_PUSH_TIME (); def_list = (MPlist *) mdatabase_load (mdb); - MDEBUG_PRINT_TIME ("CODING", (stderr, " to load the data.")); + MDEBUG_PRINT_TIME ("CODING", (mdebug__output, " to load the data.")); MDEBUG_POP_TIME (); if (! def_list) return -1; @@ -3054,8 +3057,8 @@ mcoding__load_from_database () MDEBUG_PUSH_TIME (); MPLIST_DO (plist, def_list) { - MPlist *pl; - MSymbol name; + MPlist *pl, *aliases; + MSymbol name, canonicalized; if (! MPLIST_PLIST_P (plist)) MERROR (MERROR_CHARSET, -1); @@ -3063,19 +3066,31 @@ 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); + aliases = mplist_get (pl, Maliases); + if (aliases) + MPLIST_DO (aliases, aliases) + if (MPLIST_SYMBOL_P (aliases)) + { + name = MPLIST_SYMBOL (aliases); + canonicalized = msymbol__canonicalize (name); + definitions = mplist_add (definitions, canonicalized, pl); + M17N_OBJECT_REF (pl); + } } M17N_OBJECT_UNREF (def_list); - MDEBUG_PRINT_TIME ("CODING", (stderr, " to parse the loaded data.")); + MDEBUG_PRINT_TIME ("CODING", (mdebug__output, " to parse the loaded data.")); MDEBUG_POP_TIME (); return 0; } /*** @} */ #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */ + /* External API */ @@ -3083,63 +3098,59 @@ mcoding__load_from_database () /*** @{ */ /*=*/ -/***en @name Variables: Symbols representing a coding system */ -/***oldja @name ÊÑ¿ô: ÄêµÁºÑ¤ß¥³¡¼¥É·Ï¤ò»ØÄꤹ¤ë¤¿¤á¤Î¥·¥ó¥Ü¥ë */ +/***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. */ -/***oldja - @brief MIME charset "US-ASCII" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë +/***ja + @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. */ -/***oldja - @brief MIME charset "ISO-8859-1" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë +/***ja + @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. */ -/***oldja - @brief RFC 2279 ¤Î "UTF-8" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë¡ÊUnicode ÍÑ¡Ë +/***ja + @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 @@ -3147,82 +3158,117 @@ MSymbol Mcoding_utf_8; limited to the Unicode characters. It can encode all characters supported by the m17n library. */ -/***oldja - @brief RFC 2279 ¤Î "UTF-8" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë¡ÊÁ´Ê¸»úÍÑ¡Ë +/***ja + @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). */ -/***oldja - @brief RFC 2781 ¤Î "UTF-16" ¤ËÂбþ¤¹¤ë¥³¡¼¥É·Ï¤Î¥·¥ó¥Ü¥ë +/***ja + @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; /*** @} */ @@ -3230,14 +3276,16 @@ 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; -/*=*/ - MSymbol Mcharsets; MSymbol Mflags; MSymbol Mdesignation; @@ -3249,7 +3297,9 @@ MSymbol Mlittle_endian; /*=*/ /***en - @name Variables: Symbols representing coding system type. */ + @name Variables: Symbols representing coding system types. */ +/***ja + @name ÊÑ¿ô¡§ ¥³¡¼¥É·Ï¤Î¥¿¥¤¥×¤ò¼¨¤¹¥·¥ó¥Ü¥ë. */ /*** @{ */ /*=*/ @@ -3257,6 +3307,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; /*=*/ @@ -3266,16 +3320,19 @@ 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 @b Mflags parameter of a coding system used in an argument to the mconv_define_coding () function (which see). */ +/***ja + ´Ø¿ô mconv_define_coding () ¤Î°ú¿ô¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¥³¡¼¥É·Ï¤Î¥Ñ¥é¥á¡¼¥¿ + @b Mflags ¤ÎÃͤȤʤêÆÀ¤ë¥·¥ó¥Ü¥ë¡£(¾ÜºÙ¤Ï + mconv_define_coding ()»²¾È)¡£ */ MSymbol Mreset_at_eol; -/*=*/ MSymbol Mreset_at_cntl; MSymbol Meight_bit; MSymbol Mlong_form; @@ -3294,161 +3351,168 @@ MSymbol Mfull_support; /*=*/ /***en - @name Variables: etc + @name Variables: Others Remaining variables. */ -/***oldja @name ÊÑ¿ô: ¤½¤Î¾ */ +/***ja @name ÊÑ¿ô: ¤½¤Î¾ + + ¤Û¤«¤ÎÊÑ¿ô¡£ */ /*** @{ */ /*=*/ /***en @brief Symbol whose name is "maybe". The variable #Mmaybe is a symbol of name "maybe". It is - used a value of #Mbom parameter of the function + used a value of @b Mbom parameter of the function mconv_define_coding () (which see). */ +/***ja + @brief "maybe"¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë. + + ÊÑ¿ô #Mmaybe ¤Ï "maybe" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¡£¤³¤ì¤Ï´Ø¿ô + mconv_define_coding () ¥Ñ¥é¥á¡¼¥¿ @b 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". */ -/***oldja - @brief ¥·¥ó¥Ü¥ë @c Mcoding +/***ja + @brief ¥·¥ó¥Ü¥ë @c Mcoding. - ¥Ç¥³¡¼¥É¤µ¤ì¤¿ M-text ¤Ï¡¢¥­¡¼¤¬ @c Mcoding ¤Ç¤¢¤ë¤è¤¦¤Ê¥Æ¥­¥¹¥È¥× - ¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¥·¥ó¥Ü¥ë @c Mcoding ¤Ï "coding" ¤È¤¤¤¦Ì¾ - Á°¤Ç¤¢¤é¤«¤¸¤áÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ */ + ¥Ç¥³¡¼¥É¤µ¤ì¤¿ M-text ¤Ï¤¹¤Ù¤Æ¡¢¥­¡¼¤¬ÄêµÁºÑ¤ß¥·¥ó¥Ü¥ë @c Mcoding + ¤Ç¤¢¤ë¤è¤¦¤Ê¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ò»ý¤Ä¡£¥·¥ó¥Ü¥ë @c Mcoding ¤Ï + "coding" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¡£ */ 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: