iconv

Autres langues

Langue: ja

Autres versions - même langue

Version: 2001-11-15 (openSuse - 09/10/07)

Autres sections - même nom

Section: 3 (Bibliothèques de fonctions)

̾Á°

iconv - ʸ»ú¥»¥Ã¥ÈÊÑ´¹¤ò¹Ô¤¦

½ñ¼°


#include <iconv.h>



size_t iconv(iconv_t cd,

             char **inbuf, size_t *inbytesleft,

             char **outbuf, size_t *outbytesleft);

ÀâÌÀ

°ú¤­¿ô cd ¤Ï¡¢´Ø¿ô iconv_open(3) ¤ò»È¤Ã¤ÆÀ¸À®¤µ¤ì¤ë ÊÑ´¹¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£

¼ç¤Ë»È¤ï¤ì¤ë¤Î¤Ï¡¢ ¡Öinbuf ¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä *inbuf ¤¬ NULL ¤Ç¤Ê¤¤¡× ¤È¤¤¤¦¾ì¹ç¤Ç¤¢¤ë¡£ ¤³¤Î¾ì¹ç¡¢ iconv() ´Ø¿ô¤Ï¡¢ *inbuf ¤Ç»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò *outbuf ¤Ç»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£ *inbuf ¤òÀèƬ¤È¤·¤ÆºÇÂç *inbytesleft ¥Ð¥¤¥È¤¬Æɤ߹þ¤Þ¤ì¡¢ *outbuf ¤òÀèƬ¤È¤·¤ÆºÇÂç *outbytesleft ¥Ð¥¤¥È¤¬½ñ¤­½Ð¤µ¤ì¤ë¡£

iconv() ´Ø¿ô¤Ï 1 ÅÙ¤Ë 1 ¤Ä¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤òÊÑ´¹¤¹¤ë¡£ ¤½¤·¤Æ¡¢³Æʸ»úÊÑ´¹Ëè¤Ë¡¢ÊÑ´¹¤µ¤ì¤¿ÆþÎϥХ¤¥È¤Î¿ô¤À¤± *inbuf ¤òÁý²Ã¤µ¤»¡¢*inbytesleft ¤ò¸º¾¯¤µ¤»¤ë¡£ ¤Þ¤¿¡¢ÊÑ´¹¤µ¤ì¤¿½ÐÎϥХ¤¥È¤Î¿ô¤À¤± *outbuf ¤òÁý²Ã¤µ¤»¡¢*outbytesleft ¤ò¸º¾¯¤µ¤»¤ë¡£ ¤µ¤é¤Ë¡¢cd ¤Ë´Þ¤Þ¤ì¤ëÊÑ´¹¾õÂÖ¤ò¹¹¿·¤¹¤ë¡£ ÊÑ´¹¤Ï¡¢¼¡¤Î 4 ¤Ä¤Î¾ì¹ç¤ËÄä»ß¤¹¤ë¡£

1. ÆþÎϤË̵¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬤¢¤Ã¤¿¾ì¹ç¡£ ¤³¤Î¾ì¹ç¡¢´Ø¿ô¤Ï errno ¤ò EILSEQ ¤ËÀßÄꤷ¡¢(size_t)(-1) ¤òÊÖ¤¹¡£ *inbuf ¤Ï¡¢Ìµ¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ÎÀèƬ¤ò»Ø¤·¤¿¤Þ¤Þ¤Ë¤Ê¤ë¡£

2. ÆþÎϥХ¤¥Èʸ»úÎ󤬴°Á´¤ËÊÑ´¹¤µ¤ì¡¢*inbytesleft ¤¬ 0 ¤Ë¤Ê¤Ã¤¿¾ì¹ç¡£ ¤³¤Î¾ì¹ç¡¢ iconv() ¤Ï¡¢¸Æ½Ð¤·¤Î´Ö¤ËÈó²ÄµÕÊÑ´¹¤¬¹Ô¤ï¤ì¤¿²ó¿ô¤òÊÖ¤¹¡£

3. ÆþÎϤËÉÔ´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬤¢¤ê¡¢ ÆþÎϥХ¤¥Èʸ»úÎ󤬤½¤Î¸å¤Ç½ªÎ»¤·¤Æ¤¤¤ë¾ì¹ç¡£ ¤³¤Î¾ì¹ç¡¢´Ø¿ô¤Ï¡¢errno ¤ò EINVAL ¤ËÀßÄꤷ¡¢(size_t)(-1) ¤òÊÖ¤¹¡£ *inbuf ¤Ï¡¢ÉÔ´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ÎÀèƬ¤ò»Ø¤·¤¿¤Þ¤Þ¤Ë¤µ¤ì¤ë¡£

4. ½ÐÎϥХåե¡¡¼¤Ë¼¡¤ÎÊÑ´¹¤µ¤ì¤¿Ê¸»úÎó¤Î¤¿¤á¤Î¶õ¤­¤¬¤Ê¤¤¾ì¹ç¡£ ¤³¤Î¾ì¹ç¡¢errno ¤¬ E2BIG ¤ËÀßÄꤵ¤ì¡¢(size_t)(-1) ¤¬ÊÖ¤µ¤ì¤ë¡£

Ê̤Υ±¡¼¥¹¤È¤·¤Æ¤Ï¡¢ ¡Öinbuf ¤¬ NULL¡¢¤Þ¤¿¤Ï *inbuf ¤¬ NULL ¤Ç¤¢¤ë¡£ ¤·¤«¤·¡¢outbuf ¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä *outbuf ¤¬ NULL ¤Ç¤Ê¤¤¡× ¤È¤¤¤¦¾ì¹ç¤¬¤¢¤ë¡£ ¤³¤Î¾ì¹ç¡¢ iconv() ´Ø¿ô¤Ï¡¢cd ¤ÎÊÑ´¹¾õÂÖ¤ò½é´ü¾õÂ֤ˤ·¤Æ¡¢ Âбþ¤¹¤ë¥·¥Õ¥Èʸ»úÎó¤ò *outbuf ¤ËÊݸ¤·¤è¤¦¤È¤¹¤ë¡£ ºÇÂç *outbytesleft ¥Ð¥¤¥È¤¬¡¢*outbuf ¤ò»Ï¤á¤È¤·¤Æ½ñ¤­½Ð¤µ¤ì¤ë¡£ ¤³¤Î¥ê¥»¥Ã¥È¤µ¤ì¤¿Ê¸»úÎó¤ËÂФ·¤Æ¡¢½ÐÎϥХåե¡¡¼¤Ë¶õ¤­¤¬¤Ê¤¤¾ì¹ç¡¢ ¤³¤Î´Ø¿ô¤Ï errno ¤ò E2BIG ¤ËÀßÄꤷ¡¢(size_t)(-1) ¤òÊÖ¤¹¡£ ¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï¡¢½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¤Î¿ô¤À¤± *outbuf ¤òÁý²Ã¤µ¤»¡¢*outbytesleft ¤ò¸º¾¯¤µ¤»¤ë¡£

3 ÈÖÌܤΥ±¡¼¥¹¤·¤Æ¤Ï¡¢ ¡Öinbuf ¤¬ NULL¡¢¤Þ¤¿¤Ï *inbuf ¤¬ NULL ¤Ç¤¢¤ë¡£ ¤«¤Ä¡¢outbuf ¤¬ NULL¡¢¤Þ¤¿¤Ï *outbuf ¤¬ NULL ¤Ç¤¢¤ë¡× ¤È¤¤¤¦¾ì¹ç¤¬¤¢¤ë¡£ ¤³¤Î¾ì¹ç¡¢ iconv() ´Ø¿ô¤Ï¡¢cd ¤ÎÊÑ´¹¾õÂÖ¤ò½é´ü¾õÂ֤ˤ¹¤ë¡£

ÊÖ¤êÃÍ

iconv() ´Ø¿ô¤Ï¡¢¸Æ½Ð¤·¤Î´Ö¤ËÈó²ÄµÕ¤ÊÊýË¡¤ÇÊÑ´¹¤µ¤ì¤¿Ê¸»ú¿ô¤òÊÖ¤¹¡£ ¤Ä¤Þ¤ê¡¢²ÄµÕÊÑ´¹¤Ï¥«¥¦¥ó¥È¤µ¤ì¤Ê¤¤¡£ ¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï errno ¤òÀßÄꤷ¡¢(size_t)(-1) ¤òÊÖ¤¹¡£

¥¨¥é¡¼

¾¤Î¤¤¤í¤¤¤í¤Ê¥¨¥é¡¼¤Î¤¦¤Á¤«¤é¡¢°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ê¤¦¤ë¡£
E2BIG
*outbuf ¤Ë½½Ê¬¤Ê¶õ¤­¤¬¤Ê¤¤¡£
EILSEQ
ÆþÎϤË̵¸ú¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬤¢¤Ã¤¿¡£
EINVAL
ÆþÎϤËÉÔ´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬤¢¤Ã¤¿¡£

½àµò

POSIX.1-2001.

´ØÏ¢¹àÌÜ

iconv_close(3), iconv_open(3)