2 #====================================================================================================#
3 # tr2uni v0.1 (Turkish-iso8859-9 encoder to Unicode) #
4 #==================================================================================================== #
6 # This is PHP function for covert Turkish encoding string to #
7 # unicode that can use to show Turkish charactor in function ImageTTFText(). #
8 # It Tested and worked with Multilanguage arial.ttf V2.98 #
11 # Bug Report and Suggestion to: #
15 #==================================================================================================== #
17 # include_once($root_path.'inc_ttf_tr2uni.php'); #
18 # ImageTTFText ($image, 8, 0, 3, 15, $white, "arial.ttf",tr2uni("$Turkishstring")); #
19 #====================================================================================================#
21 # version 0.1 : First release for Arabic. created on ( 22/01/2004) By Walid Fathalla #
22 # version 0.1.1: First release for Turkish created on ( 01/11/2005) By Bulent Potur #
23 # For Arabic Website: If you thing this module useful to you, please send to #
24 # me back to my email fathalla_w@hotmail.com. #
26 #====================================================================================================# #================================================// Turkish character maps//=============================================
27 $tr2unimap = array( // One bit character isolated form
28 '1' => "1", '2' => "2", '3' => "3", '4' => "4", '5' => "5", '6' => "6", '7' => "7",
29 '8' => "8", '9' => "9", '0' => "0", '/' => "/", '+' => "+", '-' => "-", '?' => "?",
30 ',' => ",", '.' => ".", '?' => "?", 'A' => "A", 'B' => "B", 'C' => "C", 'Ç' => "Ç",
31 'D' => "D", 'E' => "E", 'F' => "F", 'G' => "G", 'Ð' => "Ğ", 'H' => "H", 'I' => "I",
32 'Ý' => "İ", 'J' => "J", 'K' => "K", 'L' => "L", 'M' => "M", 'N' => "N", 'O' => "O",
33 'Ö' => "Ö", 'P' => "P", 'R' => "R", 'S' => "S", 'Þ' => "Ş", 'T' => "T", 'U' => "U",
34 'Ü' => "Ü", 'V' => "V", 'Y' => "Y", 'Z' => "Z", 'a' => "a", 'b' => "b", 'c' => "c",
35 'ç' => "ç", 'd' => "d", 'e' => "e", 'f' => "f", 'g' => "g", 'ð' => "ğ", 'h' => "h",
36 'ý' => "ı", 'i' => "i", 'j' => "j", 'k' => "k", 'l' => "l", 'm' => "m", 'n' => "n",
37 'o' => "o", 'ö' => "ö", 'p' => "p", 'r' => "r", 's' => "s", 'þ' => "ş", 't' => "t",
38 'u' => "u", 'ü' => "ü", 'v' => "v", 'y' => "y", 'z' => "z", '$' => "ğ", 'Q' => "Q",
39 'â' => "ı", 'w' => "w", 'W' => "Y", 'x' => "x", 'X' => "X", 'q' => "q", ' ' => " ");
41 #================================================// end of character maps//=============================================
43 function tr2uni($sti){
47 # Patch by Elpidio 2004-02-06
49 if(strstr($sti,'&#')&&strstr($sti,';')){
50 $buf=explode(';',$sti);
52 # Remove the first element which is empty
54 $sti=implode(';',$buf);
60 #$sti = strrev($temp);
63 #$sti = strrev($temp);
68 for ($i=0; $i < $len; $i++
){
70 #=========================// for one bit character have 1 form//================
71 $sto .=$tr2unimap[$sti{$i}];