=encoding euc-jp

=head1 ̾Á°

Unicode::MapUTF8 - Ǥ°Õ¤Îʸ»ú¥»¥Ã¥È¤«¤é¡¿¤Ø¤ÎUTF8¤ÎÊÑ´¹

=head1 ³µÍ×

 use Unicode::MapUTF8 qw(to_utf8 from_utf8 utf8_supported_charset);

 # 'ISO-8859-1'¤Îʸ»úÎó¤ò 'UTF8'¤ËÊÑ´¹¤¹¤ë
 my $output = to_utf8({ -string => 'An example', -charset => 'ISO-8859-1' });

 # 'UTF8'¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Îʸ»úÎó¤ò¥¨¥ó¥³¡¼¥Ç¥£¥ó¥° 'ISO-8859-1'¤ØÊÑ´¹¤¹¤ë
 my $other  = from_utf8({ -string => 'Other text', -charset => 'ISO-8859-1' });

 # ÍøÍѤǤ­¤ëʸ»ú¥»¥Ã¥È¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Î¥ê¥¹¥È
 my @character_sets = utf8_supported_charset;

 # ʸ»ú¥»¥Ã¥ÈÊÌ̾¤ÎÄɲÃ
 utf8_charset_alias({ 'ms-japanese' => 'sjis' });

 # £²¤Ä¤ÎǤ°Õ¤Î¡Ê¤·¤«¤·Â礭¤¯¸ß´¹À­¤Î¤¢¤ë¡Ëʸ»ú¥»¥Ã¥È¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ç¤ÎÊÑ´¹
 # (SJIS to EUC-JP)
 my $utf8_string   = to_utf8({ -string =>$sjis_string, -charset => 'sjis'});
 my $euc_jp_string = from_utf8({ -string => $utf8_string, -charset => 'euc-jp' })

 # ÆÃÄê¤Îʸ»ú¥»¥Ã¥È¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤ò³Îǧ
 if (utf8_supported_charset('ISO-8859-1') {
     # Yes
 }

=head1 ÀâÌÀ

UTF8¤È¤½¤Î¾¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤«¤é¡¿¤Ø¤ÎÊÑ´¹¤Î¤¿¤á¤ÎÃæ³Ë¤È¤Ê¤ë¥ë¡¼¥Á¥ó¤Î´Ö¤Î¥¢¥À¥×¥¿ÁؤòÄ󶡤·¤Þ¤¹¡£ËܼÁŪ¤Ë¤Ï¡¢Ê£¿ô¸ºß¤¹¤ë
Unicode¥â¥¸¥å¡¼¥ë¤Ø¤Î£±¤Ä¤Î¶¦Ä̤Υ¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¡¢²¼Éߤ­¤Ë¤Ê¤Ã¤Æ¤¤¤ë¼ÂÁõ¤òÃΤ뤳¤È¤Ê¤¯¡¢´Êñ¤ËUTF8¤«¤é¡¿¤Ø¾¤Îʸ»ú¥»¥Ã¥È¥¨¥ó¥³¡¼¥Ç¥£
¥ó¥°ÊÑ´¹¤ò´Êñ¤Ë¤ª¤³¤Ê¤¤¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢¤³¤ì¤ÏUnicode::String¡¢Unicode::Map8¡¢Unicode::Map¡¢Jcode¥â
¥¸¥å¡¼¥ë¤òɸ½à²½¤µ¤ì¤¿´Êñ¤ÊAPI¤ÎÃæ¤ËÊñ¤ß¤Þ¤¹¡£

¤Þ¤¿¤³¤ì¤ÏUTF-8¤ò¥Ù¡¼¥¹¤Ë°ìÈÌŪ¤Êʸ»ú¥»¥Ã¥ÈÊÑ´¹¤âÄ󶡤·¤Þ¤¹¡Ý¤³¤ì¤Ï£²Ãʳ¬¤ÎÊÑ´¹¤Ä¤Ê¤²¤ë¤³¤È¤Ë¤è¤ê¡¢£²¤Ä¤Î¸ß´¹À­¤¬¤¢¤ê¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëʸ»ú¥»¥Ã¥È¤Ç²Äǽ¤Ç¤¹¡£

¤Û¤È¤ó¤É¤Î¤³¤È¤¬PerlŪ¤Ê¤Î¤Ç¡Ý¤«¤ßºÕ¤¯ÂоݤȤ·¤Æ¿ô¿¤¯¤Î¾®¤µ¤¤¤Ê¤â¤Î¤ÎÂå¤ï¤ê¤Ë£²¡¢£³¤ÎÂ礭¤Ê¸Ç¤Þ¤ê¤òÍ¿¤¨¤ë¤È¡¢1Éô֤ˤè¤ê¿¤¯¤Îʸ»ú¤ò°·¤¤¤Þ¤¹¡£

À߷פǤϡ¢Åо줹¤ë¤¤¤«¤Ê¤ë¿·¤·¤¤Ê¸»ú¥»¥Ã¥È¡¦¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°ÊÑ´¹¥â¥¸¥å¡¼¥ë¤â¼è¤ê¹þ¤à¤è¤¦¤Ë´Êñ¤Ë³ÈÄ¥¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

=head1 Êѹ¹ÅÀ

¡Ê¸¶Ê¸¤Î¤Þ¤Þ¡Ë

=head1 ´Ø¿ô

1.14 2020.09.27   Fixing POD breaking in EUC-JP version of POD

1.13 2020.09.27   Fixing MANIFEST.SKIP error

1.12 2020.09.27   Build tool updates. Maintainer updates. POD error fixes.
                  Relicensed under MIT license.

1.11 2005.10.10   Documentation changes. Addition of Build.PL support.
                  Added various build tests, LICENSE, Artistic_License.txt,
                  GPL_License.txt. Split documentation into seperate
                  .pod file. Added Japanese translation of POD.

1.10 2005.05.22 - Fixed bug in conversion of ISO-2022-JP to UTF-8.
                  Problem and fix found by Masahiro HONMA
                  <masahiro.honma@tsutaya.co.jp>.

                  Similar bugs in conversions of shift_jis and euc-jp
                  to UTF-8 corrected as well.

1.09 2001.08.22 - Fixed multiple typo occurances of 'uft'
                  where 'utf' was meant in code. Problem affected
                  utf16 and utf7 encodings. Problem found
                  by devon smith <devon@taller.PSCL.cwru.edu>

1.08 2000.11.06 Added 'utf8_charset_alias' function to allow for runtime
                setting of character set aliases. Added several alternate
                names for 'sjis' (shiftjis, shift-jis, shift_jis, s-jis,
                and s_jis). 

                Corrected 'croak' messages for 'from_utf8' functions to
                appropriate function name.

                Corrected fatal problem in jcode-unicode internals. Problem 
                and fix found by Brian Wisti <wbrian2@uswest.net>.

1.07 2000.11.01 Added 'croak' to use Carp declaration to fix error
                messages. Problem and fix found by <wbrian2@uswest.net>.

1.06 2000.10.30 Fix to handle change in stringification of overloaded
                objects between Perl 5.005 and 5.6.  
                Problem noticed by Brian Wisti <wbrian2@uswest.net>.

1.05 2000.10.23 Error in conversions from UTF8 to multibyte encodings corrected

1.04 2000.10.23 Additional diagnostic error messages added for
                internal errors

1.03 2000.10.22 Bug fix for load time Unicode::Map encoding
                detection

1.02 2000.10.22 Bug fix to 'from_utf8' method and load time
                detection of Unicode::Map8 supported character
                set encodings

1.01 2000.10.02 Initial public release

=head1 関数

=over

=item utf8_charset_alias({ $alias => $charset });

ʸ»ú¥»¥Ã¥ÈÊÌ̾¤Î¼Â¹Ô»þ¤ÎÂåÆþ¤Ë»È¤ï¤ì¤Þ¤¹¡£

°ú¿ô¤Ê¤·¤Ç¸Æ¤Ð¤ì¤ë¤È¡¢ÄêµÁ¤µ¤ì¤Æ¤¤¤ëÊÌ̾¤È¡¢¤½¤ì¤Ë¥Þ¥Ã¥×¤µ¤ì¤ëʸ»ú¥»¥Ã¥È¤Î¥Ï¥Ã¥·¥å¤òÊÖ¤·¤Þ¤¹¡£

Î㡧:

  my $aliases     = utf8_charset_alias;
  my @alias_names = keys %$aliases;

£±¤Ä¤Î¥Ñ¥é¥á¡¼¥¿ÉÕ¤­¤Ç¸Æ¤Ð¤ì¤ë¤È¡¢¤â¤·¤½¤ÎÊÌ̾¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢'ËÜÅö¤Î'ʸ»ú¥»¥Ã¥È¤Î̾Á°¤òÊÖ¤·¤Þ¤¹¡£¤½¤ì¤¬ÊÌ̾¤Ë¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ðundef¤òÊÖ¤·¤Þ¤¹¡£

Î㡧

    if (! utf8_charset_alias('VISCII')) {
        # No alias for this
    }

¤â¤·'alias' => 'charset'¤ÎÁȤΥꥹ¥È¤Ç¸Æ¤Ð¤ì¤ì¤Ð¡¢¤½¤ì¤é¤ÎÊÌ̾¤¬»È¤¨¤ë¤è¤¦¤ËÄêµÁ¤·¤Þ¤¹¡£

Î㡧

    utf8_charset_alias({ 'japanese' => 'sjis', 'japan' => 'sjis' });

Ãí°Õ¡§ÅϤµ¤ì¤¿ÁȤ¬¡¢Í½¤áÄêµÁ¤µ¤ì¤Æ¤¤¤ëʸ»ú¥»¥Ã¥È¡¦¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Î½¸¹ç¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ëʸ»ú¥»¥Ã¥È¤Ë¥Þ¥Ã¥×¤µ¤ì¤Ê¤±¤ì¤Ð¡¢croak¤·¤Þ¤¹¡£¤³¤ì¤Ï¾¤ÎÊÌ̾¤Ø¤ÎÊÌ̾¤òµö¤·¤Æ¤Ï¤¤¤Þ¤»¤ó¡£

Ê£¿ô¤Îʸ»ú¥»¥Ã¥È¤ò£±²ó¤Î¸Æ½Ð¤·¤ÇÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

ÊÌ̾¤ò¥¯¥ê¡¼¥ó¤¹¤ë¤¿¤á¤Ë¤Ï¡¢undef¤Îʸ»ú¥»¥Ã¥È¥Þ¥Ã¥Ô¥ó¥°¤òÅϤ·¤Þ¤¹¡£

Î㡧

    utf8_charset_alias({ 'japanese' => undef });

ÊÌ̾¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë´Ö¡¢¤â¤·Í½¤áÄêµÁ¤µ¤ì¤Æ¤¤¤ëʸ»ú¥»¥Ã¥È¤Ç¤¢¤ì¤Ð¡¢'utf8_supported_charset' ´Ø¿ô¤ÏÊÌ̾¤òÊÖ¤·¤Þ¤¹¡£

´ðËܤÎÄêµÁ¤µ¤ì¤¿Ê¸»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤òÊÌ̾¤Ç¥ª¡¼¥Ð¡¼¥é¥¤¥É¤¹¤ë¤È¡¢É¸½à¥¨¥é¡¼¡ÊSTDERR)¤Ø¤Î·Ù¹ð¥á¥Ã¥»¡¼¥¸¤ò½Ð¤·¤Þ¤¹¡£

=back

=over

=item utf8_supported_charset($charset_name);

¡Ê¥æ¡¼¥¶¤¬ÄêµÁ¤·¤¿ÊÌ̾¤â´Þ¤á¤Æ¡Ë̾¤Å¤±¤é¤ì¤¿Ê¸»ú¥»¥Ã¥È¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ì¤Ðtrue¤òÊÖ¤·¤Þ¤¹¡£<p>¤½¤¦¤Ç¤Ê¤±¤ì¤Ðfalse¤òÊÖ¤·¤Þ¤¹¡£

Î㡧

    if (! utf8_supported_charset('VISCII')) {
        # ¤Þ¤À¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó
    }

¥Ñ¥é¥á¡¼¥¿¤Ê¤·¤Ç¡¢¥ê¥¹¥È¡¦¥³¥ó¥Æ¥­¥¹¥È¤Ç¸Æ¤Ð¤ì¤ë¤È¡¢¡Ê¥æ¡¼¥¶¤¬ÄêµÁ¤·¤¿ÊÌ̾¤â´Þ¤á¤Æ¡Ë¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Îʸ»ú¥»¥Ã¥È̾¤Î¥ê¥¹¥È¤òÊÖ¤·¤Þ¤¹¡£

Î㡧

    my @charsets = utf8_supported_charset;

=back

=over

=item to_utf8({ -string => $string, -charset => $source_charset });

»ØÄꤵ¤ì¤¿¸µ¤Îʸ»ú¥»¥Ã¥È(source charset)¤«¤éUTF8¤ËÊÑ´¹¤µ¤ì¤¿Ê¸»úÎó¤òÊÖ¤·¤Þ¤¹¡£

=back

=over

=item from_utf8({ -string => $string, -charset => $target_charset});

UTF8¤«¤é»ØÄꤵ¤ì¤¿¥¿¡¼¥²¥Ã¥È¤Îʸ»ú¥»¥Ã¥È(target charset)¤ËÊÑ´¹¤µ¤ì¤¿Ê¸»úÎó¤òÊÖ¤·¤Þ¤¹¡£

=back

=head1 ¥Ð¡¼¥¸¥ç¥ó

1.12 - 2020.09.27

=head1 ¤ä¤ë¤Ù¤­¤³¤È

Jcode¡¢2¥Ð¥¤¥È¡¦¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤½¤·¤Æ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°ÊÌ̾¤Î¤¿¤á¤ÎµÕ¹Ô¥Æ¥¹¥È

=head1 »²¹Í»ñÎÁ

L<Unicode::String> L<Unicode::Map8> L<Unicode::Map> L<Jcode>

=head1 Ãøºî¸¢

Copyright 2000-2020, Jerilyn Franz. All rights reserved.

=head1 ºî¼Ô

Jerilyn Franz <cpan@jerilyn.info>

=head1 ¥¯¥ì¥¸¥Ã¥È

Àî¹ç¹§Åµ "Kawai,Takanori" <GCD00051@nifty.ne.jp> - Ë®Ìõ

=head1 ¥é¥¤¥»¥ó¥¹


MIT License

Copyright (c) 2020 Jerilyn Franz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

=cut