/* 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
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
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. */
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 */
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:
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:
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,
M17N_OBJECT_UNREF (charsets);
M17N_OBJECT_UNREF (param);
+ M17N_OBJECT_UNREF (pl);
return 0;
}
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 ();
MPLIST_DO (plist, def_list)
{
- MPlist *pl;
+ MPlist *pl, *aliases;
MSymbol name, canonicalized;
if (! MPLIST_PLIST_P (plist))
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);
/***ja
mconv_define_coding () Íѥѥé¥á¡¼¥¿¥¡¼ (¾ÜºÙ¤Ï mconv_define_coding ()»²¾È). */
MSymbol Mtype;
-/*=*/
-
MSymbol Mcharsets;
MSymbol Mflags;
MSymbol Mdesignation;
/*=*/
/***en
- @name Variables: Symbols appearing in the value of #Mflags parameter. */
+ @name Variables: Symbols appearing in the value of Mflags parameter. */
/***ja
- @name ÊÑ¿ô¡§ ¥Ñ¥é¥á¡¼¥¿ #Mflags ¤ÎÃͤȤʤêÆÀ¤ë¥·¥ó¥Ü¥ë. */
+ @name ÊÑ¿ô¡§ ¥Ñ¥é¥á¡¼¥¿ Mflags ¤ÎÃͤȤʤêÆÀ¤ë¥·¥ó¥Ü¥ë. */
/*** @{ */
-/*=*/
-
/***en
- Symbols 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 () ¤Î°ú¿ô¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¥³¡¼¥É·Ï¤Î¥Ñ¥é¥á¡¼¥¿
- #Mflags ¤ÎÃͤȤʤêÆÀ¤ë¥·¥ó¥Ü¥ë¡£(¾ÜºÙ¤Ï
+ @b Mflags ¤ÎÃͤȤʤêÆÀ¤ë¥·¥ó¥Ü¥ë¡£(¾ÜºÙ¤Ï
mconv_define_coding ()»²¾È)¡£ */
MSymbol Mreset_at_eol;
-/*=*/
MSymbol Mreset_at_cntl;
MSymbol Meight_bit;
MSymbol Mlong_form;
/*=*/
/***en
- @name Variables: etc
+ @name Variables: Others
Remaining variables. */
/***ja @name ÊÑ¿ô: ¤½¤Î¾
@brief Symbol whose name is "maybe".
The variable #Mmaybe is a symbol of name <tt>"maybe"</tt>. 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 ¤Ï <tt>"maybe"</tt> ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¡£¤³¤ì¤Ï´Ø¿ô
- mconv_define_coding () ¥Ñ¥é¥á¡¼¥¿ #Mbom ¤ÎÃͤȤ·¤ÆÍѤ¤¤é¤ì¤ë¡£
+ mconv_define_coding () ¥Ñ¥é¥á¡¼¥¿ @b Mbom ¤ÎÃͤȤ·¤ÆÍѤ¤¤é¤ì¤ë¡£
(¾ÜºÙ¤Ï mconv_define_coding () »²¾È)¡£ */
MSymbol Mmaybe;
<li> Key is @c Mtype, value is a symbol
The value specifies the type of the coding system. It must be
- #Mcharset, #Mutf, #Miso_2022, or #Mnil.
+ @b Mcharset, @b Mutf, @b Miso_2022, or @b Mnil.
- If the type is #Mcharset, $EXTRA_INFO is ignored.
+ If the type is @b Mcharset, $EXTRA_INFO is ignored.
- If the type is #Mutf, $EXTRA_INFO must be a pointer to
+ If the type is @b Mutf, $EXTRA_INFO must be a pointer to
#MCodingInfoUTF.
- If the type is #Miso_2022, $EXTRA_INFO must be a pointer to
+ If the type is @b 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.
- <li> Key is #Mcharsets, value is a plist
+ <li> Key is @b Mcharsets, value is a plist
The value specifies a list charsets supported by the coding
system. The keys of the plist must be #Msymbol, and the values
must be symbols representing charsets.
- <li> Key is #Mflags, value is a plist
+ <li> Key is @b Mflags, value is a plist
- If the type is #Miso_2022, the values specifies flags to control
+ If the type is @b Miso_2022, the values specifies flags to control
the ISO 2022 interpreter. The keys of the plist must e #Msymbol,
and values must be one of the following.
<ul>
- <li> #Mreset_at_eol
+ <li> @b Mreset_at_eol
If this flag exists, designation and invocation status is reset to
the initial state at the end of line.
- <li> #Mreset_at_cntl
+ <li> @b Mreset_at_cntl
If this flag exists, designation and invocation status is reset to
the initial state at a control character.
- <li> #Meight_bit
+ <li> @b Meight_bit
If this flag exists, the graphic plane right is used.
- <li> #Mlong_form
+ <li> @b Mlong_form
If this flag exists, the over-long escape sequences (ESC '$' '('
- <final_byte>) are used for designating the CCS JISX0208.1978,
+ \<final_byte\>) are used for designating the CCS JISX0208.1978,
GB2312, and JISX0208.
- <li> #Mdesignation_g0
+ <li> @b Mdesignation_g0
- If this flag and #Mfull_support exists, designates charsets not
+ If this flag and @b Mfull_support exists, designates charsets not
listed in the charset list to the graphic register G0.
- <li> #Mdesignation_g1
+ <li> @b Mdesignation_g1
- If this flag and #Mfull_support exists, designates charsets not
+ If this flag and @b Mfull_support exists, designates charsets not
listed in the charset list to the graphic register G1.
- <li> #Mdesignation_ctext
+ <li> @b Mdesignation_ctext
- If this flag and #Mfull_support exists, designates charsets not
+ If this flag and @b Mfull_support exists, designates charsets not
listed in the charset list to a graphic register G0 or G1 based on
the criteria of the Compound Text.
- <li> #Mdesignation_ctext_ext
+ <li> @b Mdesignation_ctext_ext
- If this flag and #Mfull_support exists, designates charsets not
+ If this flag and @b Mfull_support exists, designates charsets not
listed in the charset list to a graphic register G0 or G1, or use
extended segment for such charsets based on the criteria of the
Compound Text.
- <li> #Mlocking_shift
+ <li> @b Mlocking_shift
If this flag exists, use locking shift.
- <li> #Msingle_shift
+ <li> @b Msingle_shift
If this flag exists, use single shift.
- <li> #Msingle_shift_7
+ <li> @b Msingle_shift_7
If this flag exists, use 7-bit single shift code (0x19).
- <li> #Meuc_tw_shift
+ <li> @b Meuc_tw_shift
If this flag exists, use a special shifting according to EUC-TW.
- <li> #Miso_6429
+ <li> @b Miso_6429
This flag is currently ignored.
- <li> #Mrevision_number
+ <li> @b Mrevision_number
If this flag exists, use a revision number escape sequence to
designate a charset that has a revision number.
- <li> #Mfull_support
+ <li> @b Mfull_support
If this flag exists, support all charsets registered in the
International Registry.
</ul>
- <li> Key is #Mdesignation, value is a plist
+ <li> Key is @b Mdesignation, value is a plist
- If the type is #Miso_2022, the value specifies how to designate
+ If the type is @b Miso_2022, the value specifies how to designate
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
to any register at first, and if necessary, is designated to the
(G+4) graphic register.
- <li> Key is #Minvocation, value is a plist
+ <li> Key is @b Minvocation, value is a plist
- If the type is #Miso_2022, the value specifies how to invocate
+ If the type is @b Miso_2022, the value specifies how to invocate
each graphic registers. The plist length must be one or two. The
keys of the plist must be #Minteger, and the values must be
numbers indicating a graphic register. The value of the first
second element specifies which graphic register is invocated to
the graphic plane right.
- <li> Key is #Mcode_unit, value is an integer
+ <li> Key is @b Mcode_unit, value is an integer
- If the type is #Mutf, the value specifies the bit length of a
+ If the type is @b Mutf, the value specifies the bit length of a
code-unit. It must be 8, 16, or 32.
- <li> Key is #Mbom, value is a symbol
+ <li> Key is @b Mbom, value is a symbol
- If the type is #Mutf and the code-unit bit length is 16 or 32,
+ If the type is @b Mutf and the code-unit bit length is 16 or 32,
it specifies whether or not to use BOM (Byte Order Mark). If the
value is #Mnil (default), BOM is not used, else if the value is
#Mmaybe, the existence of BOM is detected at decoding time, else
BOM is used.
- <li> Key is #Mlittle_endian, value is a symbol
+ <li> Key is @b Mlittle_endian, value is a symbol
- If the type is #Mutf and the code-unit bit length is 16 or 32,
+ If the type is @b Mutf and the code-unit bit length is 16 or 32,
it specifies whether or not the encoding is little endian. If the
value is #Mnil (default), it is big endian, else it is little
endian.
<li> ¥¡¼¤¬ @c Mtype ¤ÇÃͤ¬¥·¥ó¥Ü¥ë¤Î»þ
- Ãͤϥ³¡¼¥É·Ï¤Î¥¿¥¤¥×¤òɽ¤·¡¢#Mcharset, #Mutf, #Miso_2022, #Mnil
+ Ãͤϥ³¡¼¥É·Ï¤Î¥¿¥¤¥×¤òɽ¤·¡¢@b Mcharset, @b Mutf, @b Miso_2022, #Mnil
¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
- ¥¿¥¤¥×¤¬ #Mcharset ¤Ê¤é¤Ð $EXTRA_INFO ¤Ï̵»ë¤µ¤ì¤ë¡£
+ ¥¿¥¤¥×¤¬ @b Mcharset ¤Ê¤é¤Ð $EXTRA_INFO ¤Ï̵»ë¤µ¤ì¤ë¡£
- ¥¿¥¤¥×¤¬ #Mutf ¤Ê¤é¤Ð $EXTRA_INFO ¤Ï #MCodingInfoUTF
+ ¥¿¥¤¥×¤¬ @b Mutf ¤Ê¤é¤Ð $EXTRA_INFO ¤Ï #MCodingInfoUTF
¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
- ¥¿¥¤¥×¤¬ #Miso_2022¤Ê¤é¤Ð $EXTRA_INFO ¤Ï #MCodingInfoISO2022
+ ¥¿¥¤¥×¤¬ @b Miso_2022¤Ê¤é¤Ð $EXTRA_INFO ¤Ï #MCodingInfoISO2022
¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
¥¿¥¤¥×¤¬ #Mnil ¤Ê¤é¤Ð¡¢°ú¿ô $RESETTER, $DECODER, $ENCODER
¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¤³¤ì¤é¤Ï @c NULL ¤Ç¤è¤¯¡¢
m17n ¥é¥¤¥Ö¥é¥ê¤¬Å¬Àڤʥǥե©¥ë¥ÈÃͤòÍ¿¤¨¤ë¡£
- <li> ¥¡¼¤¬ #Mcharsets ¤ÇÃͤ¬ plist ¤Î»þ
+ <li> ¥¡¼¤¬ @b Mcharsets ¤ÇÃͤ¬ plist ¤Î»þ
ÃͤϤ³¤Î¥³¡¼¥É·Ï¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤ëʸ»ú¥»¥Ã¥È¤Î¥ê¥¹¥È¤Ç¤¢¤ë¡£plist¤Î¥¡¼¤Ï
#Msymbol¡¢ÃͤÏʸ»ú¥»¥Ã¥È¤ò¼¨¤¹¥·¥ó¥Ü¥ë¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
- <li> ¥¡¼¤¬ #Mflags Ãͤ¬ plist ¤Î»þ
+ <li> ¥¡¼¤¬ @b Mflags Ãͤ¬ plist ¤Î»þ
- ¥¿¥¤¥×¤¬ #Miso_2022 ¤Ê¤é¤Ð¡¢¤³¤ÎÃͤÏ, ISO 2022
+ ¥¿¥¤¥×¤¬ @b Miso_2022 ¤Ê¤é¤Ð¡¢¤³¤ÎÃͤÏ, ISO 2022
¥¤¥ó¥¿¥×¥ê¥¿ÍѤÎÀ©¸æ¥Õ¥é¥Ã¥°¤ò¼¨¤¹¡£plist ¤Î¥¡¼¤Ï #Msymbol
¤Ç¤¢¤ê¡¢Ãͤϰʲ¼¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£
<ul>
- <li> #Mreset_at_eol
+ <li> @b Mreset_at_eol
¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢¿Þ·Áʸ»ú½¸¹ç¤Î»Ø¼¨¤ä¸Æ½Ð¤Ï¹ÔËö¤Ç¥ê¥»¥Ã¥È¤µ¤ì¤ÆÅö½é¤Î¾õÂÖ¤ËÌá¤ë¡£
- <li> #Mreset_at_cntl
+ <li> @b Mreset_at_cntl
¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢¿Þ·Áʸ»ú½¸¹ç¤Î»Ø¼¨¤ä¸Æ½Ð¤ÏÀ©¸æʸ»ú¤Ë½Ð²ñ¤Ã¤¿»þÅÀ¤Ç¥ê¥»¥Ã¥È¤µ¤ì¤ÆÅö½é¤Î¾õÂÖ¤ËÌá¤ë¡£
- <li> #Meight_bit
+ <li> @b Meight_bit
¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢¿Þ·Áʸ»ú½¸¹ç¤Î±¦È¾Ì̤¬ÍѤ¤¤é¤ì¤ë¡£
- <li> #Mlong_form
+ <li> @b Mlong_form
¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢Ê¸»ú½¸¹ç JISX0208.1978, GB2312, JISX0208
¤ò»Ø¼¨¤¹¤ëºÝ¤Ë over-long ¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ (ESC '$' '('
- <final_byte>) ¤¬ÍѤ¤¤é¤ì¤ë¡£
+ \<final_byte\>) ¤¬ÍѤ¤¤é¤ì¤ë¡£
- <li> #Mdesignation_g0
+ <li> @b Mdesignation_g0
- ¤³¤Î¥Õ¥é¥°¤È #Mfull_support ¤¬¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Ë¸½¤ï¤ì¤Ê¤¤Ê¸»ú¥»¥Ã¥È¤ò
+ ¤³¤Î¥Õ¥é¥°¤È @b Mfull_support ¤¬¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Ë¸½¤ï¤ì¤Ê¤¤Ê¸»ú¥»¥Ã¥È¤ò
G0 ½¸¹ç¤Ë»Ø¼¨¤¹¤ë¡£
- <li> #Mdesignation_g1
+ <li> @b Mdesignation_g1
- ¤³¤Î¥Õ¥é¥°¤È #Mfull_support ¤¬¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Ë¸½¤ï¤ì¤Ê¤¤Ê¸»ú¥»¥Ã¥È¤ò
+ ¤³¤Î¥Õ¥é¥°¤È @b Mfull_support ¤¬¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Ë¸½¤ï¤ì¤Ê¤¤Ê¸»ú¥»¥Ã¥È¤ò
G1 ½¸¹ç¤Ë»Ø¼¨¤¹¤ë¡£
- <li> #Mdesignation_ctext
+ <li> @b Mdesignation_ctext
- ¤³¤Î¥Õ¥é¥°¤È #Mfull_support ¤¬¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Ë¸½¤ï¤ì¤Ê¤¤Ê¸»ú¥»¥Ã¥È¤ò
+ ¤³¤Î¥Õ¥é¥°¤È @b Mfull_support ¤¬¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Ë¸½¤ï¤ì¤Ê¤¤Ê¸»ú¥»¥Ã¥È¤ò
G0 ½¸¹ç¤Þ¤¿¤Ï G1 ½¸¹ç¤Ë¡¢¥³¥ó¥Ñ¥¦¥ó¥É¥Æ¥¥¹¥È¤Î´ð½à¤Ë¤½¤Ã¤Æ»Ø¼¨¤¹¤ë¡£
- <li> #Mdesignation_ctext_ext
+ <li> @b Mdesignation_ctext_ext
- ¤³¤Î¥Õ¥é¥°¤È #Mfull_support ¤¬¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Ë¸½¤ï¤ì¤Ê¤¤Ê¸»ú¥»¥Ã¥È¤ò
+ ¤³¤Î¥Õ¥é¥°¤È @b Mfull_support ¤¬¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Ë¸½¤ï¤ì¤Ê¤¤Ê¸»ú¥»¥Ã¥È¤ò
G0 ½¸¹ç¤Þ¤¿¤Ï G1 ½¸¹ç¤Ë¡¢¤¢¤ë¤¤¤Ï³ÈÄ¥¥»¥°¥á¥ó¥È¤Ë¥³¥ó¥Ñ¥¦¥ó¥É¥Æ¥¥¹¥È¤Î´ð½à¤Ë¤½¤Ã¤Æ»Ø¼¨¤¹¤ë¡£
- <li> #Mlocking_shift
+ <li> @b Mlocking_shift
¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢¥í¥Ã¥¥ó¥°¥·¥Õ¥È¤òÍѤ¤¤ë¡£
- <li> #Msingle_shift
+ <li> @b Msingle_shift
¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢¥·¥ó¥°¥ë¥·¥Õ¥È¤òÍѤ¤¤ë¡£
- <li> #Msingle_shift_7
+ <li> @b Msingle_shift_7
¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢7-bit ¥·¥ó¥°¥ë¥·¥Õ¥È¥³¡¼¥É (0x19) ¤òÍѤ¤¤ë¡£
- <li> #Meuc_tw_shift
+ <li> @b Meuc_tw_shift
¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢EUC-TW ¤Ë±è¤Ã¤¿ÆÃÊ̤ʥ·¥Õ¥È¤òÍѤ¤¤ë¡£
- <li> #Miso_6429
+ <li> @b Miso_6429
¸½»þÅÀ¤Ç¤ÏÍѤ¤¤é¤ì¤Æ¤¤¤Ê¤¤¡£
- <li> #Mrevision_number
+ <li> @b Mrevision_number
¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢revision number ¤ò»ý¤Äʸ»ú¥»¥Ã¥È¤ò»Ø¼¨¤¹¤ëºÝ¤Ë
revision number ¥¨¥¹¥±¡¼¥×¥·¡¼¥¯¥¨¥ó¥¹¤òÍѤ¤¤ë¡£
- <li> #Mfull_support
+ <li> @b Mfull_support
¤³¤Î¥Õ¥é¥°¤¬¤¢¤ì¤Ð¡¢the International Registry
¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëÁ´Ê¸»ú¥»¥Ã¥È¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£
</ul>
- <li> ¥¡¼¤¬ #Mdesignation¤ÇÃͤ¬ plist ¤Î»þ
+ <li> ¥¡¼¤¬ @b Mdesignation ¤ÇÃͤ¬ plist ¤Î»þ
- ¥¿¥¤¥×¤¬ #Miso_2022 ¤Ê¤é¤Ð¡¢ÃͤϳÆʸ»ú¤ò¤É¤Î¤è¤¦¤Ë»Ø¼¨¤¹¤ë¤«¤ò¼¨¤¹¡£
+ ¥¿¥¤¥×¤¬ @b Miso_2022 ¤Ê¤é¤Ð¡¢ÃͤϳÆʸ»ú¤ò¤É¤Î¤è¤¦¤Ë»Ø¼¨¤¹¤ë¤«¤ò¼¨¤¹¡£
plist ¤Î¥¡¼¤Ï #Minteger¡¢ÃͤϽ¸¹ç¡Êgraphic register¡Ë
¤ò¼¨¤¹¿ô»ú¤Ç¤¢¤ë¡£NÈÖÌܤÎÍ×ÁǤÎÃͤϡ¢Ê¸»ú¥»¥Ã¥È¥ê¥¹¥È¤Î N
ÈÖÌܤÎʸ»ú¥»¥Ã¥È¤ËÂбþ¤¹¤ë¡£Ãͤ¬ 0..3 ¤Ç¤¢¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¤¬¤¹¤Ç¤Ë
Ãͤ¬Éé(-4..-1) ¤Ç¤¢¤ì¤Ð¡¢½é´ü¾õÂ֤ǤÏʸ»ú¥»¥Ã¥È¤¬¤É¤³¤Ë¤â»Ø¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¡¢É¬ÍפʺݤˤÏ
G0..G3 ¤Î¤½¤ì¤¾¤ì¤Ë»Ø¼¨¤¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£
- <li> ¥¡¼¤¬ #Minvocation¤ÇÃͤ¬ plist ¤Î»þ
+ <li> ¥¡¼¤¬ @b Minvocation ¤ÇÃͤ¬ plist ¤Î»þ
- ¥¿¥¤¥×¤¬ #Miso_2022 ¤Ê¤é¤Ð¡¢Ãͤϳƽ¸¹ç¤ò¤É¤Î¤è¤¦¤Ë¸Æ¤Ó½Ð¤¹¤«¤ò¼¨¤¹¡£
+ ¥¿¥¤¥×¤¬ @b Miso_2022 ¤Ê¤é¤Ð¡¢Ãͤϳƽ¸¹ç¤ò¤É¤Î¤è¤¦¤Ë¸Æ¤Ó½Ð¤¹¤«¤ò¼¨¤¹¡£
plist ¤ÎŤµ¤Ï 1 ¤Ê¤¤¤· 2 ¤Ç¤¢¤ë¡£plist ¤Î¥¡¼¤Ï
#Minteger¡¢ÃͤϽ¸¹ç¡Êgraphic register)¤ò¼¨¤¹¿ô»ú¤Ç¤¢¤ë¡£
ºÇ½é¤ÎÍ×ÁǤÎÃͤ¬¿Þ·Áʸ»ú½¸¹çº¸È¾Ì̤˸ƤӽФµ¤ì¤ë½¸¹ç¤ò¼¨¤¹¡£
plist ¤ÎŤµ¤¬ 1 ¤Ê¤é¤Ð¡¢±¦È¾Ì̤ˤϲ¿¤â¸Æ¤Ó½Ð¤µ¤ì¤Ê¤¤¡£
¤½¤¦¤Ç¤±¤ì¤Ð¡¢£²¤Ä¤á¤ÎÍ×ÁǤÎÃͤ¬¿Þ·Áʸ»ú½¸¹ç±¦È¾Ì̤˸ƤӽФµ¤ì¤ë½¸¹ç¤ò¼¨¤¹¡£
- <li> ¥¡¼¤¬ #Mcode_unit ¤ÇÃͤ¬À°¿ôÃͤλþ
+ <li> ¥¡¼¤¬ @b Mcode_unit ¤ÇÃͤ¬À°¿ôÃͤλþ
- ¥¿¥¤¥×¤¬ #Mutf ¤Ê¤é¤Ð¡¢Ãͤϥ³¡¼¥É¥æ¥Ë¥Ã¥È¤Î¥Ó¥Ã¥ÈŤǤ¢¤ê¡¢8, 16,
+ ¥¿¥¤¥×¤¬ @b Mutf ¤Ê¤é¤Ð¡¢Ãͤϥ³¡¼¥É¥æ¥Ë¥Ã¥È¤Î¥Ó¥Ã¥ÈŤǤ¢¤ê¡¢8, 16,
32 ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£
- <li> ¥¡¼¤¬ #Mbom ¤ÇÃͤ¬¥·¥ó¥Ü¥ë¤Î»þ
+ <li> ¥¡¼¤¬ @b Mbom ¤ÇÃͤ¬¥·¥ó¥Ü¥ë¤Î»þ
- ¥¿¥¤¥×¤¬ #Mutf ¤Ç¥³¡¼¥É¥æ¥Ë¥Ã¥È¤Î¥Ó¥Ã¥ÈŤ¬ 16 ¤« 32¤Ê¤é¤Ð¡¢ÃͤÏ
+ ¥¿¥¤¥×¤¬ @b Mutf ¤Ç¥³¡¼¥É¥æ¥Ë¥Ã¥È¤Î¥Ó¥Ã¥ÈŤ¬ 16 ¤« 32¤Ê¤é¤Ð¡¢ÃͤÏ
BOM (Byte Order Mark) ¤ò»ÈÍѤ¹¤ë¤«¤É¤¦¤«¤ò¼¨¤¹¡£Ãͤ¬¥Ç¥Õ¥©¥ë¥ÈÃͤÎ
#Mnil ¤Ê¤é¤Ð¡¢»ÈÍѤ·¤Ê¤¤¡£Ãͤ¬ #Mmaybe ¤Ê¤é¤Ð¥Ç¥³¡¼¥É»þ¤Ë BOM
¤¬¤¢¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£¤½¤ì°Ê³°¤Ê¤é¤Ð»ÈÍѤ¹¤ë¡£
- <li> ¥¡¼¤¬ #Mlittle_endian ¤ÇÃͤ¬¥·¥ó¥Ü¥ë¤Î»þ
+ <li> ¥¡¼¤¬ @b Mlittle_endian ¤ÇÃͤ¬¥·¥ó¥Ü¥ë¤Î»þ
- ¥¿¥¤¥×¤¬ #Mutf ¤Ç¥³¡¼¥É¥æ¥Ë¥Ã¥È¤Î¥Ó¥Ã¥ÈŤ¬ 16 ¤« 32
+ ¥¿¥¤¥×¤¬ @b Mutf ¤Ç¥³¡¼¥É¥æ¥Ë¥Ã¥È¤Î¥Ó¥Ã¥ÈŤ¬ 16 ¤« 32
¤Ê¤é¤Ð¡¢Ãͤϥ¨¥ó¥³¡¼¥É¤¬ little endian ¤«¤É¤¦¤«¤ò¼¨¤¹¡£Ãͤ¬¥Ç¥Õ¥©¥ë¥ÈÃͤÎ
#Mnil ¤Ê¤é¤Ð big endian ¤Ç¤¢¤ê¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð little endian ¤Ç¤¢¤ë¡£
mconv_stream_converter () */
MConverter *
-mconv_buffer_converter (MSymbol name, unsigned char *buf, int n)
+mconv_buffer_converter (MSymbol name, const unsigned char *buf, int n)
{
MCodingSystem *coding;
MConverter *converter;
internal->unread = mtext ();
internal->work_mt = mtext ();
mtext__enlarge (internal->work_mt, MAX_UTF8_CHAR_BYTES);
- internal->buf = buf;
+ internal->buf.in = buf;
internal->used = 0;
internal->bufsize = n;
internal->binding = BINDING_BUFFER;
$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 ()
+ @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
#merror_code. */
converter->nchars = converter->nbytes = 0;
converter->result = MCONVERSION_RESULT_SUCCESS;
internal->carryover_bytes = 0;
+ internal->used = 0;
mtext_reset (internal->unread);
if (internal->coding->resetter)
return (*internal->coding->resetter) (converter);
mconv_rebind_stream () */
MConverter *
-mconv_rebind_buffer (MConverter *converter, unsigned char *buf, int n)
+mconv_rebind_buffer (MConverter *converter, const unsigned char *buf, int n)
{
MConverterStatus *internal = (MConverterStatus *) converter->internal_info;
- internal->buf = buf;
+ internal->buf.in = buf;
internal->used = 0;
internal->bufsize = n;
internal->binding = BINDING_BUFFER;
if (internal->binding == BINDING_BUFFER)
{
- (*internal->coding->decoder) (internal->buf + internal->used,
+ (*internal->coding->decoder) (internal->buf.in + internal->used,
internal->bufsize - internal->used,
mt, converter);
internal->used += converter->nbytes;
mconv_decode (), mconv_decode_stream () */
MText *
-mconv_decode_buffer (MSymbol name, unsigned char *buf, int n)
+mconv_decode_buffer (MSymbol name, const unsigned char *buf, int n)
{
MConverter *converter = mconv_buffer_converter (name, buf, n);
MText *mt;
if (internal->binding == BINDING_BUFFER)
{
(*internal->coding->encoder) (mt, from, to,
- internal->buf + internal->used,
+ internal->buf.out + internal->used,
internal->bufsize - internal->used,
converter);
internal->used += converter->nbytes;