میوانی بهڕێز، بهخێرهاتی بۆ مهكۆكانی وێبچن، وهك میوان دهتوانی ههموو بابهتهكانی مهكۆكان بخوێنیتهوه و پێویست به خۆ تۆمار كردن ناكات، بۆ ئهوهی بتوانی بابهت و پرسیار بنووسیت پێویسته خۆت تۆمار بكهیت كه چهند ههنگاوێكی زۆر ئاسان و كورته بۆ جێبهجێ كردن
پهڕهكان: 1

سڵاو بهڕێزان، ههموومان کێشهی زمانی کووردیمان ههیه وێبدا، بهتایبهتی له زمانی پ هـ پ دا پاڵپشتی ڕاستهوخۆ نیه بۆ جۆری UTF-8، زۆر جار دهقهکان تێکدهچن و دهگۆڕێن و ... هتد، یاخوود گهر بتهوێت ژمارهی پیتهکانی دهقێکی کوردی یونیکۆد له پ هـ پ دا بدۆزیتهوه ئهوا دهبێت چارهسهری بکهیت و فرمانێکی دهرهکی بۆ دروست بکهیت.
من ئهم بهرنامهیه پێشکهش به ئێوه دهکهم (مافی لهبهرگرتنهوهی پارێزراوه بۆ webchin.org)، ههر کهس ئازاده ئیتر چی لهو بهرنامهیه دهکات به گوێرهی یاساکانی webchin.org.
تێبینی: وهشانی یهکهمی ئهم بهرنامهیهم له ماڵپهری php.net بڵاو کردۆتهوه لهم بهستهره http://www.php.net/utf8_encode، ئهمه وهشانی دووهمه
ئهم بهرنامهیهم لهم بهستهرهدا داناوه، ئامادهیه بۆ کارپێکردن:
http://www.kurdphp.com/utf_unicode.php
ئهم بهستهرهش بۆ داگرتنی:
http://www.kurdphp.com/utf_unicode.zip
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>UTF-8 <===> Unicode Convertor</title>
<meta name="keywords" content="UTF-8 to Unicode Convertor, Unicode to UTF-8 Convertor, HTML to Entities Value, String to Unicode, UTF-8 6 bit Support" />
<meta name="description" content="UTF-8 to Unicode Convertor, Unicode to UTF-8 Convertor, HTML to Entities Value, String to Unicode, UTF-8 6 bit Support" />
<style type="text/css">
input{
cursor:hand;
font-family:Tahoma;
font-size:13px;
background-color:#000000;
border-color:silver;
color:white;
font-weight:bold;
}
textarea{
font-family:Tahoma;
font-size:13px;
background-color:white;
border:1px black solid;
color:#333333;
}
.tdtext{
text-align: left;
border: 1px solid #000000;
font-size:13px;
padding:8px;
}
.main{
width: 700px;
font-family: Tahoma;
}
.center{
text-align: center;
}
</style>
</head>
<body>
<?php
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ akam AT AkamENG dot COM
@ UTF-8 <--> Unicode Convertor
@ Supports 6 bit
@ For my Kurdish People!
*/
$input = $_POST['input'];
$convert = $_POST['convert'];
if($convert == 'UTF-8 to Unicode' && $input){
//$converted = str_replace('&', '&', htmlentities(UTF_to_Unicode($input)));
$converted = htmlspecialchars(UTF_to_Unicode($input));
$unikurd = htmlspecialchars(Unicode_to_UTF(unikurd(UTF_to_Unicode($input))));
}
if($convert == 'Unicode to UTF-8' && $input){
$converted = htmlspecialchars(Unicode_to_UTF($input));
}
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
*@ function Unicode_to_UTF: Decode Unicode Values to UTF-8
*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
function Unicode_to_UTF( $input, $array=TRUE){
if(!is_array($input)){
$input = str_replace('&#', '', $input);
$input = explode(';', $input);
$len = count($input);
unset($input[$len-1]);
}
for($i=0; $i < count($input); $i++){
/* Decoding 1 bit
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
if ( $input[$i] < 128 ){
$byte1 = $input[$i];
$utf .= chr($byte1);
}
/* Decoding 2 bit
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
if ( $input[$i] >= 128 && $input[$i] <= 2047 ){
$byte1 = 192 + (int)($input[$i] / 64);
$byte2 = 128 + ($input[$i] % 64);
$utf .= chr($byte1).chr($byte2);
}
/* Decoding 3 bit
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
if ( $input[$i] >=2048 && $input[$i] <=65535){
$byte1 = 224 + (int)($input[$i] / 4096);
$byte2 = 128 + ((int)($input[$i] / 64) % 64);
$byte3 = 128 + ($input[$i] % 64);
$utf .= chr($byte1).chr($byte2).chr($byte3);
}
/* Decoding 4 bit
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
if ( $input[$i] >=65536 && $input[$i] <=2097151){
$byte1 = 240 + (int)($input[$i] / 262144);
$byte2 = 128 + ((int)($input[$i] / 4096) % 64);
$byte3 = 128 + ((int)($input[$i] / 64) % 64);
$byte4 = 128 + ($input[$i] % 64);
$utf .= chr($byte1).chr($byte2).chr($byte3).chr($byte4);
}
/* Decoding 5 bit
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
if ( $input[$i] >=2097152 && $input[$i] <=67108863){
$byte1 = 248 + (int)($input[$i] / 16777216);
$byte2 = 128 + ((int)($input[$i] / 262144) % 64);
$byte3 = 128 + ((int)($input[$i] / 4096) % 64);
$byte4 = 128 + ((int)($input[$i] / 64) % 64);
$byte5 = 128 + ($input[$i] % 64);
$utf .= chr($byte1).chr($byte2).chr($byte3).chr($byte4).chr($byte5);
}
/* Decoding 6 bit
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
if ( $input[$i] >=67108864 && $input[$i] <=2147483647){
$byte1 = 252 + ($input[$i] / 1073741824);
$byte2 = 128 + (($input[$i] / 16777216) % 64);
$byte3 = 128 + (($input[$i] / 262144) % 64);
$byte4 = 128 + (($input[$i] / 4096) % 64);
$byte5 = 128 + (($input[$i] / 64) % 64);
$byte6 = 128 + ($input[$i] % 64);
$utf .= chr($byte1).chr($byte2).chr($byte3).chr($byte4).chr($byte5).chr($byte6);
}
}
return $utf;
}
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
*@ function Unicode_to_UTF: Decode Unicode Values to UTF-8
*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
function unikurd( $input ){
$arabic = array('ط', 'ظ', 'ذ', 'ض', 'ي', 'ك', 'ئ', 'ؤ', 'ي',
'ة', 'و', 'لَ', 'رِ', 'ء',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'یَ', 'ث', 'ً');
$kurdish = array('گ', 'ڤ', 'ژ', 'چ', 'ی', 'ک', 'ئ', 'ۆ', 'ی',
'ه', 'و', 'ڵ', 'ڕ', 'و',
'٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩',
'ێ', 'پ', '');
return str_replace($arabic, $kurdish, $input);
}
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
*@ function UTF_to_Unicode: Encode UTF-8 Values to Unicode
*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
function UTF_to_Unicode($input, $array=False) {
$value = '';
$val = array();
for($i=0; $i< strlen( $input ); $i++){
$ints = ord ( $input[$i] );
$z = ord ( $input[$i] );
$y = ord ( $input[$i+1] ) - 128;
$x = ord ( $input[$i+2] ) - 128;
$w = ord ( $input[$i+3] ) - 128;
$v = ord ( $input[$i+4] ) - 128;
$u = ord ( $input[$i+5] ) - 128;
/* Encoding 1 bit
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
if( $ints >= 0 && $ints <= 127 ){
// 1 bit
$value[]= '&#'.($z).';';
//$val[] = $value;
}
/* Encoding 2 bit
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
if( $ints >= 192 && $ints <= 223 ){
// 2 bit
//$value[]= '&#'.(($z-192) * 64 + $y).';';
$value[]= '&#'.(($z-192) * 64 + $y).';';
//$val[] = $value;
}
/* Encoding 3 bit
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
if( $ints >= 224 && $ints <= 239 ){
// 3 bit
$value[]= '&#'.(($z-224) * 4096 + $y * 64 + $x).';';
//$val[] = $value;
}
/* Encoding 4 bit
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
if( $ints >= 240 && $ints <= 247 ){
// 4 bit
$value[]= '&#'.(($z-240) * 262144 + $y * 4096 + $x * 64 + $w).';';
}
/* Encoding 5 bit
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
if( $ints >= 248 && $ints <= 251 ){
// 5 bit
$value[]= '&#'.(($z-248) * 16777216 + $y * 262144 + $x * 4096 + $w * 64 + $v).';';
}
/* Encoding 6 bit
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
if( $ints == 252 || $ints == 253 ){
// 6 bit
$value[]= '&#'.(($z-252) * 1073741824 + $y * 16777216 + $x * 262144 + $w * 4096 + $v * 64 + $u).';';
}
/* Wrong Ord!
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
if( $ints == 254 || $ints == 255 ){
echo 'Wrong Result!<br>';
}
}
if( $array === False ){
$unicode = '';
foreach($value as $value){
$unicode .= $value;
}
/*
$val = str_replace('&#', '', $value);
$val = explode(';', $val);
$len = count($val);
unset($val[$len-1]);
*/
return $unicode;
}
if($array === True ){
return $value;
}
}
?>
<center>
<table class="main" cellspacing="4" cellpadding="0">
<tr>
<td class="center">
<form method="post">
<table style="width: 700px" cellspacing="0" cellpadding="0">
<tr>
<td><textarea name="input" style="width: 689px; height: 250px"></textarea><br />
</td>
</tr>
<tr>
<td>
<input name="convert" type="submit" value="UTF-8 to Unicode" /> <input name="convert" type="submit" value="Unicode to UTF-8" /></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td style="font-size: 18px; direction: rtl; height: 64px; text-align:center"><strong>
Converted text<br />
<span>تێکستی وهرگێڕدراو</span></strong></td>
</tr>
<tr>
<td style="width: 700px"><textarea name="input" style="width: 689px; height: 200px"><?php echo $converted; ?></textarea> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td style="direction: rtl; height: 64px; text-align:center"><span style="font-size: 18px">
<strong>Unikurd Text<br />
<span>تێکستی وهرگێڕدراو بۆ یونیکورد</span></strong></span></td>
</tr>
<tr>
<td style="width: 700px"><textarea name="input" style="width: 689px; height: 150px"><?php echo $unikurd; ?></textarea> </td>
</tr>
</table>
</center>
</body>
</html>وا باشتره لهبهستهری داگرتنهوه ئهم کۆده بهدهست بهێنیت
بهو هیوایهی ههموولایهک سوودمهند ببن
دواترین جار دهستكاری كراوه لهلایهن akameng (2008-08-28 15:02:23)
لێره نیه
بمبوورن، بهرنامهکه دووکاری سهرهکی دهکات:
1- نرخه ژمارهییهکانی ههموو دهقێکت دهداتێ لهسهر شێوازی Unicode (واته دهقهکان دهگؤڕێت بۆ یونیکۆد)، لێرهدا دهپرسیت ئایا نرخه ژمارهییهکان سوودیان چیه؟؟ منیش دهڵێم تۆ دهتوانیت پیتی ۆ به ژماره 1734 دهرببڕیت، وه بۆ نیشاندانی لهناو HTML دا بهم شێوهیه:
&#XXXX;
XXXX واته ژمارهی پیتهکه
2- به پێچهوانهشهوه نرخه ژمارهییهکان دهگؤڕێتهوه بۆ سهرجۆری دهقی.
ههندێك وهڕگێڕانی تریش که پیته عهرهبیهکان دهگۆڕێته سهر کوردی ههریهکه بهگوێرهی بهرکهوتهی خۆی
دواترین جار دهستكاری كراوه لهلایهن akameng (2008-08-26 21:41:59)
لێره نیه
دهستخۆش، بابهتهكه ههڵواسرا.
لێره نیه
سوپاس کاک ئاسۆ،
دهترسم ڕۆژێک خۆشم ههڵواسن له یهکێک لهم مهکۆیان![]()
لێره نیه
![]()
لێره نیه
هههههههههههههههههههههههههههههه ، دهستخۆش ، ههههههههههه كاك ئاسۆ ئا ههڵی پاچه ، ههه
ههر سهركهوتوو بیت
لێره نیه
Webchin.org نهك .com ![]()
دواترین جار دهستكاری كراوه لهلایهن Broosk (2008-08-26 22:47:14)
لێره نیه
ههر بژیت هیوای سهرکهوتن.برا
بژین.
لێره نیه
کاکه برووسک ئهگهر بکرێت ههموو نوسینهکه مهخهره نێو دهقهوه ( به Quote) چونکه لهوانهیه پهڕهکه کهمێک قورس بکرێتهوه بهتایبهتی له کوردستان
وا چاکم کرد زۆر سووپاس (ههڵهیهکی گهورهیه نهدهبوایه بمبوورن )
لێره نیه
بهڕێز akameng ههر كهسێك ئازاده چی دهكات به مهرجێك له چوار چێوهی یاساكان بێت،
لێره نیه
ئهوه منیش لام برد مامه گیان ، دهستخۆش دووباره
لێره نیه
پهڕهكان: 1