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