Correction of Chinese garbled characters in pmwiki

Source: Internet
Author: User
Correction of Chinese garbled characters in pmwiki

Rocket (an alumnus next to the Department of Chemistry) sent a letter saying "Let the pmwiki side support Chinese gb2312", benefiting a lot.

The following content is transferred from chinix.net

For pmwiki. phpProgramThe modification is as follows (based on 0.5.5 and other versions, and so on ):

1) line 185 ~ 187
$ Newline = "\ 262 ";
$ Keeptoken = "/263 ";
$ Linktoken = "/264 ";
Change
$ Newline = "\ x81"; // $ newline = "\ 262"; // Modi by rocket. 2003.6.25
$ Keeptoken = "\ x82"; // $ keeptoken = "\ 263"; // Modi by rocket. 2003.6.25
$ Linktoken = "\ x83"; // $ linktoken = "\ 264"; // Modi by rocket. 2003.6.25

2) There are two subprograms involved in reading in the program:
Line 764
Function handlebrowse ($ pagename)
The role is to read files.

Line 802
Function handleedit ($ pagename)
The function is to read files for editing this page.

Subfunctions: patch_gb2312 () and patch_backold ()
Function patch_gb2312 ($ pagefilename ){
// Add by rocket. 2003.6.25
Global $ newline, $ keeptoken, $ linktoken;
If (file_exists ('wikilib. d/'. $ pagefilename )&! File_exists ('wiki. d/'. $ pagefilename )){
$ Newline = "\ 262 ";
$ Keeptoken = "/263 ";
$ Linktoken = "/264 ";
}
}

Function patch_backold (){
// Add by rocket. 2003.6.25
Global $ newline, $ keeptoken, $ linktoken;
$ Newline = "\ 262 ";
$ Keeptoken = "/263 ";
$ Linktoken = "/264 ";
}
Join team end line 997.

Modify line769 of handlebrowse () and line 806 of handleedit ()
If (! $ Page) {abort ("invalid Page name ");}
Change
If (! $ Page) {abort ("invalid Page name");} else patch_gb2312 ($ pagename); // Modi by rocket. 2003.6.25

3) since the pmwiki. editquickreference must be output after handleedit to quickly edit the reference, this is an old document, which changes back to the old separator regardless of November 21, so line 812 is modified and the variable value is forced:
$ Htmltitle = "Edit $ pagename"; $ gcount = 0;
Changed:
$ Htmltitle = "Edit $ pagename"; $ gcount = 0; patch_backold (); // Modi by rocket. 2003.6.25

4) There are some minor changes, and some of you may have done the following:
Set line57
"Content-Type: text/html; charset = iso-8859-1 ;");
Changed:
"Content-Type: text/html; charset = gb2312;"); // "Content-Type: text/html; charset = iso-8859-1;"); Modi by rocket. 2003.6.25

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.