Difference between revisions of "Onna.t"
Jump to navigation
Jump to search
(Created page with "onna.t is PHP program that returns encoding of 3 similar characters:<br> ⼥ (X2F25)<br> 女 (X5973)<br> 女 (XF981) At the default...") |
|||
Line 4: | Line 4: | ||
女 ([[XF981]]) |
女 ([[XF981]]) |
||
+ | The last one has certain problem:<br> |
||
At the default setting of mediawiki, |
At the default setting of mediawiki, |
||
− | article with name 女 cannot be accesssed |
+ | article with name 女 cannot be accesssed;<br> |
− | + | An attempt to access |
|
[[女]] ([[XF981]]) redirects to [[女]] ([[X5973]]). |
[[女]] ([[XF981]]) redirects to [[女]] ([[X5973]]). |
||
For this case, some programming is necessary. |
For this case, some programming is necessary. |
||
Line 12: | Line 13: | ||
For the execution, file [[uni.t]] also should be loaded. |
For the execution, file [[uni.t]] also should be loaded. |
||
==Program== |
==Program== |
||
+ | <div style="margin:-14px -14px -14px -200px; background-color:#ffFFff;"> |
||
+ | <div style="margin:4px 0px 4px 28px; line-height:1.2em;"> |
||
<pre> |
<pre> |
||
<?php |
<?php |
||
Line 65: | Line 68: | ||
[[Unicode]], |
[[Unicode]], |
||
[[Utf8]] |
[[Utf8]] |
||
+ | |||
+ | </div></div> |
||
[[Category:Chinese]] |
[[Category:Chinese]] |
Latest revision as of 08:00, 20 June 2021
onna.t is PHP program that returns encoding of 3 similar characters:
⼥ (X2F25)
女 (X5973)
女 (XF981)
The last one has certain problem:
At the default setting of mediawiki,
article with name 女 cannot be accesssed;
An attempt to access
女 (XF981) redirects to 女 (X5973).
For this case, some programming is necessary.
One example of the program is copy pasted below.
For the execution, file uni.t also should be loaded.
Program
<?php include "uni.t"; $a=unichr(0x2f25); // echo "$a\n"; $a.=unichr(0x5973); //echo "$a\n"; $a.=unichr(0xF981); echo "$a\n"; $N=strlen($a); echo "The array has $N bytes; here is its splitting:\n"; for($n=0;$n<$N;$n++) {printf("%02x ",ord($a[$n]) );} echo "\n"; $b = mb_str_split($a); var_dump($b); $M=count($b); for($m=0;$m<$M;$m++) { printf("\n"); $c=$b[$m]; $u=uniord($c); printf("Unicode character number %05d id est, [[X%04X]]\n",$u,$u); $d=strlen($c); echo "Picture: [[$c]]; uses $d bytes. These bytes are:\n"; for($n=0;$n<$d;$n++) printf("X%2X ",ord($c[$n])); printf("in the hexadecimal representation and\n"); for($n=0;$n<$d;$n++) printf("%3d ",ord($c[$n])); printf("in the decimal representation\n"); } ?>
How to use
for the execution, file uni.t is also rewired. Then, onna.t can be called with out parameters:
php onna.t
References
Keywords
Chinese, Japanese, PHP, Kanji, KanjiConfudal, KanjiLiberal, KanjiRadical, Onna, PHP, Unicode, Utf8