About the BIG5-HKSCS solution. It is very hard to find that PHP has always supported the problem of HKSCS which has been difficult for a long time. But not the HK-SCS, the BIG5-HKSCS. The following is a solution to the HK increment character set: the HTML dataset was found to be very bitter, and PHP has always supported the problem of HKSCS which has been difficult to understand. But not the HK-SCS, the BIG5-HKSCS.
The following is a solution to solve the HK increment character set:
The HTML faces are set as UTF-8,
Before importing data to analyticdb, iconv ('big5-hkscs ', 'utf8', $ string)
Use the following function if UNICODE is required
Function String2Unicode ($ data, $ language)
{
$ Data = nl2br (trim ($ data ));
$ Data = str_replace ('
', Chr (13), $ data );
$ Str = '';
Preg_match_all ("/[\ x80-\ xff]?. /", $ Data, $ ar );
Debug ($ ar );
Foreach ($ ar [0] as $ v)
{
If ($ v! = ''& $ V! = Chr (13 ))
{
$ Str. = "& #". utf82unicode (iconv ($ language, "UTF-8", $ v )).";";
} Else {
$ Str. = $ v;
}
}
Return $ str;
}
Function utf82unicode ($ c ){
Switch (strlen ($ c )){
Case 1:
Return ord ($ c );
Case 2:
$ N = (ord ($ c [0]) & 0x3f) <6;
$ N + = ord ($ c [1]) & 0x3f;
Return $ n;
Case 3:
$ N = (ord ($ c [0]) & 0x1f) <12;
$ N + = (ord ($ c [1]) & 0x3f) <6;
$ N + = ord ($ c [2]) & 0x3f;
Return $ n;
Case 4:
$ N = (ord ($ c [0]) & 0x0f) <18;
$ N + = (ord ($ c [1]) & 0x3f) <12;
$ N + = (ord ($ c [2]) & 0x3f) <6;
$ N + = ord ($ c [3]) & 0x3f;
Return $ n;
}
}
Bytes. But not the HK-SCS, the BIG5-HKSCS. The following is a solution to the HK increment character set...