📄 readme_php3-i18n-ja
字号:
========================================== README for I18N Package==========================================o Name and location of packageName: php-3.0.18-i18n-ja-2Location: http://www.happysize.co.jp/techie/php-ja-jp/ ftp://ftp.happysize.co.jp/php-ja-jp/ http://php.vdomains.org/ ftp://ftp.vdomains.org/pub/php-ja-jp/ http://php.jpnnet.com/Currently, this I18N version of PHP only adds Japanese support to basePHP. It allows you to use Japanese in scripts, as well as conversionbetween various Japanese encodings. It will work perfectly fine with ASCII with i18n option enabled. (note: executable is bit larger due to UNICODE table). The basic design aproach is to allow for other languages to be added in the future. Developers are encourage to joinus!For more information on Japanese encodings, please refer to the section "Additional Notes."o What is this package?This package allows you to handle multiple Japanese encodings (SJIS, EUC,UTF-8, JIS) in PHP. If you find any bugs in this package, please reportthem to the appropriate mailing list. For now, the PHP-jp mailing list is the best place for this.PHP-jp ML mailto:PHP-jp@sidecar.ics.es.osaka-u.ac.jp http://sidecar.ics.es.osaka-u.ac.jp/php-jp/ (discussions are in Japanese)o Who should use thisDue to lack of documentation, it's not intended for beginners. Ifsomething goes wrong, be prepared to fix it on your own.o Warranty and CopyrightThere is no warranty with this package. Use it at your own risk.Please refer to the source code for the copyrights. In general, eachprogram's copyright is owned by the programmer. Unless you obey thecopyright holders restrictions, you are not allowed to use it in anyform.o RedistributionAs described in the source code, this package and the components areallowed to be redistributed with certain restrictions.Due to this package being still in beta, please try to redistributeit as an entire package. Please try not to distribute it as a formof patch. Because we would prefer to have this package distributedas one single package (not patch of patch of patch), avoid releasingany patch to this package.o Who made thisA team of volunteers, PHP3 Internationalization, has been contributingtheir free time producing it. Although we are not related to the corePHP programmers, we are hoping to have our modifications merged into thecore distribution in the near future. Thus, we did not call this a"Japanese Patch" (or distribution). Our final goal is to have truei18nized PHP!For anyone interested in this project, please drop us a line.Contact Address: phpj-dev@kage.net (Discussions are in Japanese, but feel free to write us in English)Webpage (English and Japanese): http://php.jpnnet.com/Project Outline (Japanese): http://www.happysize.co.jp/techie/php-ja-jp/spec.htmDevelopers: Hironori Sato <satoh@jpnnet.com> Shigeru Kanemoto <sgk@happysize.co.jp> Tsukada Takuya <tsukada@fminn.nagano.nagano.jp> U. Kenkichi <kenkichi@axes.co.jp> Tateyama <tateyan@amy.hi-ho.ne.jp> Other gracious contributorso Future plans- fulfilling what's written in outline- support for other languages other than Japanese- make the character conversion as a library (?)- more testingo Special Thanks toPHP Japanese webpage maintainer, Hirokawa-san http://www.cityfujisawa.ne.jp/%7Elouis/apps/phpfi/PHP-JP ML's Yamamoto-san http://sidecar.ics.es.osaka-u.ac.jp/php-jp/Previous jp-patch developers========================================== Advantages of using I18N package==========================================- allows you to use various character encodings for script files and http output- distinguish character encoding in POST/GET/COOKIE- proper mail output using JIS as body and MIME/Base64/JIS subject- if http output's Content-Type is text/html, it will set proper charset- stable character encoding conversion- multibyte regex========================================== Installation==========================================o SummaryAdd --enable-i18n option when running configure. For your own setup,add any other appropriate options as well.Don't forget to copy php3.ini-dist to desired location.(ex. /usr/local/lib/php3.ini)If you have already installed PHP3, copy all the entries in php3.ini-distwhich start with "i18n.xxxx" to php3.ini.o configure option --enable-i18n include i18n features --enable-mbregex include multibyte regex library (without i18n enabled, mbregex functions will not function)o creating cgi version % tar xvzf php-3.0.18-i18n-ja-2.tar.gz % cd php-3.0.18-i18n-ja-2 % ./configure --enable-i18n --enable-mbregex % makeo creating Apache version (regular module) % tar xvzf php-3.0.18-i18n-ja-2.tar.gz % tar xvzf apache_1.3.x.tar.gz % cd apache_1.3.x % ./configure % cd ../php-3.0.18-i18n-ja-2 % ./configure --with-apache=../apache_1.3.x --enable-i18n --enable-mbregex % make % make install % cd ../apache_1.3.x % ./configure --activate-module=src/modules/php3/libphp3.a % make % make installo creating Apache DSO version create DSO capable Apache first % tar xvzf apache_1.3.x.tar.gz % cd apache-1.3.x % ./configure --enable-shared=max % make % make install now create php3 % cd php-3.0.18-i18n-ja-2 % ./configure --with-apxs=/usr/local/apache/bin/apxs --enable-i18n \ --enable-mbregex % make % make install========================================== Additional Notes==========================================o Multibyte regex libraryFrom beta4, we have included the multibyte (mb) regex library which comes withRuby. With this addition, you can now use regex in EUC, SJIS and UTF-8encoding. To avoid any conflicts with HSREGEX included with Apache,each function name has been changed. Therefore, mb regex functions arenamed differently from the original ereg functions in PHP. The characterencoding used in mb regex is configured in i18n.internal_encoding.o Binary OutputIf http output encoding is set to other than 'pass', conversion of encodingfrom internal encoding to http output is done automatically. Thus,if you prefer to spit out anything in raw binary format, your datamay be corrupted. In such event, set http_output to 'pass'.ex. <? i18n_http_output("pass"); ... echo $the_binary_data_string; ?>o Content-TypeDepending on the setting of http_output, PHP will output the proper charset.ex. Content-Type: text/html; charset="..."Be aware of following:- If you set Content-Type header using header() function, that will override the automatic addition of charset.- Be cautious when you set i18n_http_output, since if any output is made prior to this, proper header may have been sent out to the client already.o In the event of troubleIf you find any bugs or trouble, please contact us at the above address.It may help us to track the problem if you send us the script as well.If you encounter any memory related error such as segmentation violation,add --enable-debug when you run configure. This will give you moredetail information on where error has occurred. The error is storedin the server log or regular http output in CGI mode.o About Japanese encodingsDue to historical reason, there are multiple character encodings usedfor Japanese. The most common encodings are: SJIS, EUC, JIS, and UTF-8. Here are (very) brief description of them:EUC commonly used in UNIX environment 8bit-8bit combo always >=0x80SJIS commonly used in Mac or PCs similar to EUC mostly 8bit-8bit (some 8bit-7bit) mostly >=0x80 there are some halfwidth (size of ASCII) multibytesJIS commonly used in 7bit environment (nntp and smtp) starts with escaping char, \033 and a few more charactersUTF-8 16bit+ encoding defines many languages existing in this world see http://www.unicode.org/ for more detailBecause of having all these character encodings, PHP needs to translatebetween these encodings on the fly. Also, the addition of the mb regex library allows you to handle mb strings without fear of getting mb char chopped in half.Since Japanese is not the only language with multiple encodings, weencourage other developers to modify our code to suit your needs. Wedefinitely need people to work with Korean, Chinese (both traditionaland simplified), and Russian. Let us know if you are interested inthis project!========================================== php3.ini setting==========================================The following init options will allow you to change the default settings.Define these settings in the global section of php3.ini.All keywords are case-insensitive.o Encoding naming For each encoding, there are three names: standarized, alias, MIME - UTF-8 standard: UTF-8 alias: N/A mime: UTF-8 - ASCII standard: ASCII alias: N/A mime: US-ASCII - Japanese EUC standard: EUC-JP alias: EUC, EUC_JP, eucJP, x-euc-jp mime: EUC-JP - Shift JIS standard: SJIS alias: x-sjis, MS_Kanji mime: Shift_JIS - JIS standard: JIS alias: N/A mime: ISO-2022-JP - Quoted-Printable standard: Quoted-Printable alias: qprint mime: N/A - BASE64 standard: BASE64 alias: N/A mime: N/A - no conversion standard: pass alias: none mime: N/A - auto encoding detection standard: auto alias: unknown mime: N/A * N/A - Not Applicapableo i18n.http_output - default http output encoding i18n.http_output = EUC-JP|SJIS|JIS|UTF-8|pass EUC-JP : EUC SJIS: SJIS JIS : JIS UTF-8: UTF-8 pass: no conversion The default is pass (internal encoding is used) It can be re-configured on the fly using i18n_http_output().o i18n.internal_encoding - internal encoding i18n.internal_encoding = EUC-JP|SJIS|UTF-8 EUC-JP : EUC SJIS: SJIS UTF-8: UTF-8 The default is EUC-JP. PHP parser is designed based on using ISO-8859-1. For other encodings, following conditions have to be satisfied in order to use them: - per byte encoding - single byte charactor in range of 00h-7fh which is compatible with ASCII - multibyte without 00h-7fh In case of Japanese, EUC-JP and UTF-8 are the only encoding that meets this criteria. If i18n.internal_encoding and i18n.http_output differs, conversion takes place at the time of output. If you convert any data within PHP scripts to URL encoding, BASE64 or Quoted-Printable, encoding stays as defined in i18n.internal_encoding. Thus, if you would prefer to encode in compliance with i18n.http_output, you need to manually convert encoding. ex. $str = urlencode( i18n_convert($str, i18n_http_output()) );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -