Difference between revisions of "Ud.t"

From TORI
Jump to navigation Jump to search
(Created page with "<pre> <?php include "uni.t"; $K=$argc; printf("K=%2d \n",$K); for($k=1; $k<$K; $k++) { $a=$argv[$k]; $b=hexdec($a); $c=unichr($b); $u=uniord($c); printf("\n%s %5d [[&#X%04X;]]...")
 
 
Line 1: Line 1:
  +
// ud.t inputs the hexadecimal numbers and interpret them as the Unicode characters.
  +
 
<pre>
 
<pre>
 
<?php
 
<?php
Line 21: Line 23:
 
?>
 
?>
 
</pre>
 
</pre>
  +
==Dependence==
  +
  +
For the execution, file [[uni.t]] also should be loaded.
  +
Then, the call may have form
  +
  +
php yd.t hnu1 hnu2 ..
  +
  +
where "hnu?" are hexadecimal numbers (no need to type leading "0X"). Examples:
  +
  +
php ud.t 2F25 2F26 5B50
  +
  +
returns encoding of characters [[⼥]], [[X2F25]] and [[⼦]], [[X2F26]] and [[子]], [[X5B50]];
  +
  +
php ud.t 4E86 F9BA
  +
  +
returns encoding of characters [[了]], [[X4E86]] and [[&#XF9BA;]], [[XF9BA]] (that cannot be typed nor copypasted directly in the most of software);
  +
  +
php ud.t 30A1 30A2 4E86 F9BA
  +
  +
returns encoding of characters
  +
[[ァ]] [[X30A1]] and
  +
[[ア]] [[X30A2]] and
  +
[[了]], [[X4E86]] and
  +
[[&#XF9BA;]], [[XF9BA]] (that cannot be typed nor copypasted directly in the most of software);
  +
  +
[[Category:du.t]]
  +
[[Category:Japanese]]
  +
[[Category:Kanji]]
  +
[[Category:PHP]]
  +
[[Category:ud.t]]
  +
[[Category:Unicode]]
  +
[[Category:Utf8]]

Latest revision as of 03:38, 24 June 2021

// ud.t inputs the hexadecimal numbers and interpret them as the Unicode characters.

<?php
include "uni.t";
$K=$argc;
printf("K=%2d \n",$K);
for($k=1; $k<$K; $k++)
{
$a=$argv[$k];
$b=hexdec($a);
$c=unichr($b);
$u=uniord($c);
printf("\n%s %5d [[&#X%04X;]] %s\n",$a,$b,$b, $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");
} //k
?> 

Dependence

For the execution, file uni.t also should be loaded. Then, the call may have form

php yd.t hnu1 hnu2 ..

where "hnu?" are hexadecimal numbers (no need to type leading "0X"). Examples:

php ud.t 2F25 2F26 5B50

returns encoding of characters , X2F25 and , X2F26 and , X5B50;

php ud.t 4E86 F9BA

returns encoding of characters , X4E86 and , XF9BA (that cannot be typed nor copypasted directly in the most of software);

php ud.t 30A1 30A2 4E86 F9BA

returns encoding of characters X30A1 and X30A2 and , X4E86 and , XF9BA (that cannot be typed nor copypasted directly in the most of software);