Difference between revisions of "Onna.t"

From TORI
Jump to: navigation, 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...")
(No difference)

Revision as of 07:55, 20 June 2021

onna.t is PHP program that returns encoding of 3 similar characters:
(X2F25)
(X5973)
女 (XF981)

At the default setting of mediawiki, article with name 女 cannot be accesssed:
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