arabic

How to detect Arabic chars using perl regex?

爱⌒轻易说出口 提交于 2019-12-06 07:38:27
I'm parsing some html pages, and need to detect any Arabic char inside.. Tried various regexs, but no luck.. Does anyone know working way to do that? Thanks Here is the page I'm processing: http://pastie.org/2509936 And my code is: #!/usr/bin/perl use LWP::UserAgent; @MyAgent::ISA = qw(LWP::UserAgent); # set inheritance $ua = LWP::UserAgent->new; $q = 'pastie.org/2509936';; $request = HTTP::Request->new('GET', $q); $response = $ua->request($request); if ($response->is_success) { if ($response->content=~/[\p{Script=Arabic}]/g) { print "found arabic"; } else { print "not found"; } } mob EDIT (as

Working with UTF-8 in Python

怎甘沉沦 提交于 2019-12-06 07:09:32
问题 As it is summer now, I decided to learn a new language and Python was my choice. Really, what I would like to learn is how to manipulate Arabic text using Python. Now, I have found many many resources on using Python, which are really great. However, when I apply what I learned on Arabic strings, I get numbers and letters combined together. Take for example this for English: >>> ebook = 'The American English Dictionary' >>> ebook[2] 'e' Now, for Arabic: >>> abook = 'القاموس العربي' >>> abook

how could i remove arabic punctuation form a String in java

老子叫甜甜 提交于 2019-12-06 06:41:06
问题 i am working on an arabic dictionary and i am getting sentences like String original = "'أَبَنَ فُلانًا: عَابَه ورَمَاه بخَلَّة سَوء.'"; from my database but i cant process the sentence without removing the accents and punctuation i tried using import java.text.Normalizer; import java.text.Normalizer.Form; import java.util.regex.Pattern; public static String deAccent(String str) { String nfdNormalizedString = Normalizer.normalize(str, Normalizer.Form.NFD); Pattern pattern = Pattern.compile("\

export arabic text as images

坚强是说给别人听的谎言 提交于 2019-12-06 06:04:34
问题 I have a bunch of lines of Arabic text in UTF-8. The device I am trying to display this one does not support arabic text being displayed. Therefore, I need to convert the text into images. I would like to save each line of text as an image with a specific width. I need to use a specific font as well. What is the best way to do this? Does anybody know of a tool that can be helpful here? Problems I've run into so far: PHP + GD: Arabic letters appear seperated and not in cursive as they should.

Why 'ARABIC LETTER PEH' is not shown correctly on Android 3.x?

こ雲淡風輕ζ 提交于 2019-12-06 05:38:21
问题 In Unicode characters the ARABIC LETTER PEH INITIAL FORM 'ﭘ' is 0xFB58 . When I use the following code to show Unicode characters, everything is OK for every Unicode character in Android 2.2, 2.3. and 4.x But I have problem with ARABIC LETTER PEH 'ﭘ' on Android 3.x and in this case character '~' is shown. Typeface tf = Typeface.createFromAsset(context.getAssets(),"TAHOMA.TTF"); strChars = ""; strChars += (char) 0xFB58; tvChars.setTypeface(tf); tvChars.setText(strChars); I should mention that

Android : Connected and colored arabic letters

笑着哭i 提交于 2019-12-06 00:38:04
I want to display connected AND colored arabic letters on a android view (webview or textview). First, I've used TextView without color and the arabic displayed correctly. When I use spannableString, the colored letter disconnect from the word. Secondly, I've used a WebView with html and font tags. I've got the same result. Each time I try to put color on a letter in a word, this letter display disconnected from the word. Does anyone has a solution to this problem ? Android version>4.0 Thanks God after lots of struggle i found the solution. Use open source library: Better-Arabic-Reshaper 1: it

iTextSharp does not render Custom urdu font

大兔子大兔子 提交于 2019-12-05 23:24:48
I am using custom Urdu Font Jameel Noori Nastaleeq with iTextSharp but it is not showing text at all. It shows text when I use built-in forms like times.ttf etc. Code is given below: private void button1_Click(object sender, EventArgs e) { Document document = new Document(); try { PdfWriter writer = PdfWriter.GetInstance(document, new System.IO.FileStream("C:\\iTextSharpHelloworld.pdf", System.IO.FileMode.Create)); document.Open(); string fontpath = Environment.GetEnvironmentVariable("SystemRoot") + "\\fonts\\Jameel Noori Nastaleeq.ttf"; //string fontpath = Environment.GetEnvironmentVariable(

How to display Arabic dates in the Gregorian calendar?

[亡魂溺海] 提交于 2019-12-05 20:53:42
I have a multilingual ASP.NET site; one of the languages is Arabic (ar-SA). To switch between cultures, I use this code: Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Name) Thread.CurrentThread.CurrentUICulture = New CultureInfo(Name) When displaying the date of an article, for example, I just do this, and the localization API takes care of everything: <%#Eval("DatelineDate","{0:d MMMM yyyy}")%> The problem is that this displays dates using the Hijiri (Islamic) calendar (e.g. the year 2008 is rendered as 1429). The client wants to display the dates using the Gregorian

tcpdf for Arabic display the characters as question marks '?????? ???'

本秂侑毒 提交于 2019-12-05 17:00:36
I wanna create an Arabic pdf as same as the file witch I had in ms Execl format. While creating the pdf using tcpdf in php the Arabic charactors are displyaed as '????' marks. The characters are copied from my excel file $htmlcontent2 = '<span color="#0000ff">"مجوهرات السليمان"This is Arabic "مجوهرات السليمان" Example With TCPDF.</span>'; $pdf->WriteHTML($htmlcontent2, true, 0, true, 0); the output file display as below, ??? ???? ?????? ??????This is Arabic "??????? ????????" Example With TCPDF. I solved this issue by adding the following line: $pdf->SetFont('aealarabiya', '', 18); It turned

Converting Arabic numerals to Arabic/Persian numbers in html file

元气小坏坏 提交于 2019-12-05 05:16:58
问题 I am trying to convert the plain text Arabic Numerals into Eastern Arabic digits. So basically taking 1 2 3... and converting them into ١‎ ٢‎ ٣‎... . The function converts all numbers, including any numbers contained within tags, i.e. H1 . private void LoadHtmlFile(object sender, EventArgs e) { var htmlfile = "<html><body><h1>i was born in 1988</h1></body></html>".ToArabicNumber(); ; webBrowser1.DocumentText=htmlfile; } } public static class StringHelper { public static string ToArabicNumber