dsaba Posted March 26, 2007 Share Posted March 26, 2007 I am dealing with a script that reverses a string that is in hebrew, so I can display it properly when I write that string onto an image, however sometimes the string might be half hebrew half english, so I need a way to identify what language is in the string and only reverse the hebrew parts. in technical terms the hebrew text is encoded in utf-8, and the english text will be encoded in the normal encoding for english, (anscii, latin-swedish whatever, i dont know the name of that encoding) so the simple question is how do I identify different types of encoding within a string? that way I can break up the parts that i identify as being utf-8 and reverse only those (yes I am well aware of methods to display hebrew properly in php, but when writing to an image this is another story, only method i found so far is reversing the hebew text string) -all thoughts are welcome on this, even if you dont know the direct answer, perhaps other methods of doing this -thank you for your help Link to comment https://forums.phpfreaks.com/topic/44401-solved-identifying-different-unicodeutf-8-types-inside-a-text-string/ Share on other sites More sharing options...
per1os Posted March 26, 2007 Share Posted March 26, 2007 I am not sure if that is possible other than having an array of all the hebrew letters and using those to identify the parts... Link to comment https://forums.phpfreaks.com/topic/44401-solved-identifying-different-unicodeutf-8-types-inside-a-text-string/#findComment-215684 Share on other sites More sharing options...
dsaba Posted March 26, 2007 Author Share Posted March 26, 2007 thanks for the reply I discovered that you can identify the encoding of a string by the mb_encoding whatever function, however that still won't identify only hebrew since the english will be in same encoding as well so: i have written a script that makes an array of all hebrew letters and then acts upon that as the hebrew characters themselves are the defining elements to determine the language but I have a problem with my preg_match function http://www.phpfreaks.com/forums/index.php/topic,133261.0.html Link to comment https://forums.phpfreaks.com/topic/44401-solved-identifying-different-unicodeutf-8-types-inside-a-text-string/#findComment-215700 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.