arabic-support

Python arabic text returns in right-to-left orientation instead of left-to-right

此生再无相见时 提交于 2021-01-29 09:39:21
问题 I'm working on a python project with Python(3.6) and Flask in which I have to return a text in Arabic. When I print the text in the console it works well but when I return it as response it's order changes to right-to-left. Here's what I have tried: from odoa import ODOA import arabic_reshaper from bidi.algorithm import get_display from flask import Flask import json app = Flask(__name__) app.config['JSON_AS_ASCII'] = False @app.route('/', methods=['GET']) def get_an_ayah(): odoa = ODOA()

CSV file with Arabic characters is displayed as symbols in Excel

情到浓时终转凉″ 提交于 2020-05-17 07:17:05
问题 I am using python to extract Arabic tweets from twitter and save it as a CSV file, but when I open the saved file in excel the Arabic language displays as symbols. However, inside python and notepad or word, it looks good. May I know where is the problem? 回答1: This is a problem I face frequently with Microsoft Excel when opening CSV files that contain Arabic characters. Try the following workaround that I tested on latest versions of Microsoft Excel on both Windows and MacOS: Open Excel on a

how to print Arabic text correctly in PYTHON

别说谁变了你拦得住时间么 提交于 2020-01-03 11:31:09
问题 I am using Python 2.7 and i try to print Arabic strings like these print "ذهب الطالب الى المدرسة" it's give the following output: ط°ظ‡ط¨ ط§ظ„ط·ط§ظ„ط¨ ط§ظ„ظ‰ ط§ظ„ظ…ط¯ط±ط³ط© The purpose is to print the text correctly, and not how to print each line. So, how can I print the string or content of text file correctly in its original form? like: ذهب الطالب الى المدرسة 回答1: Try this: print u"ذهب الطالب الى المدرسة" Output: ذهب الطالب الى المدرسة Demo: https://repl.it/EuHM/0 The default Python2.7

how to print Arabic text correctly in PYTHON

倾然丶 夕夏残阳落幕 提交于 2020-01-03 11:30:13
问题 I am using Python 2.7 and i try to print Arabic strings like these print "ذهب الطالب الى المدرسة" it's give the following output: ط°ظ‡ط¨ ط§ظ„ط·ط§ظ„ط¨ ط§ظ„ظ‰ ط§ظ„ظ…ط¯ط±ط³ط© The purpose is to print the text correctly, and not how to print each line. So, how can I print the string or content of text file correctly in its original form? like: ذهب الطالب الى المدرسة 回答1: Try this: print u"ذهب الطالب الى المدرسة" Output: ذهب الطالب الى المدرسة Demo: https://repl.it/EuHM/0 The default Python2.7

Android: Arabic speech recognition - offline

百般思念 提交于 2019-12-23 05:34:08
问题 Can any one help me or give me a clue about Arabic speech recognition - offline for android?? I want to develop simple app that do speech recognition - offline as doing this online I know how... if any one have suggestion or link to an open source project or even library to buy that do this efficiently it will be amazing. thanks in advance. 回答1: use intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE,"ar-JO"); The below code worked fine with me: package tk.oryx.voice; import android.app.Activity;

How do I convert an Arabic String date to a java 8 date object?

╄→尐↘猪︶ㄣ 提交于 2019-12-22 03:42:34
问题 I'm working on a web monitoring project in Arabic and I want to convert string date like this one: الاثنين 24 أبريل 2017 - 15:00 to Java 8 date object. How can I do that? 回答1: Edit: with thanks to slim and Meno Hochschild for inspiration: String dateTimeString = "الاثنين 24 أبريل 2017 - 15:00"; DateTimeFormatter formatter = DateTimeFormatter.ofPattern("EEEE d MMMM uuuu - HH:mm", new Locale("ar")); LocalDateTime dateTime = LocalDateTime.parse(dateTimeString, formatter); System.out.println

Codeigniter: All Arabic routes are not working

元气小坏坏 提交于 2019-12-13 17:22:54
问题 [Update] Added to the config but still not working $config['permitted_uri_chars'] .= '%D8%A2%D8%A7%D8%A8%D9%BE%D8%AA%D8%AB%D8%AC%DA%86%D8%AD%D8%AE%D8%AF%D8%B0%D8%B1%D8%B2%D8%B3%D8%B4%D8%B5%D8%B6%D8%B7%D8%B8%D8%B9%D8%BA%D9%81%D9%82%DA%A9%DA%AF%D9%84%D9%85%D9%86%D9%88%D9%87%DB%8C%D9%8A%DB%B1%DB%B2%DB%B3%DB%B4%DB%B5%DB%B6%DB%B7%DB%B8%DB%B9%DB%B0'; $config['charset'] = 'UTF-8'; //by default I have updated Codeigniter from 2.1 to 2.2 then to 3. The issue I have is in the routes in Arabic

MySQL SELECT on Arabic Word returns 0 results on PHP but does on SQLBuddy/phpMyAdmin

爱⌒轻易说出口 提交于 2019-12-13 07:19:29
问题 Problem I am getting 0 results when searching for an Arabic word in a MySQL database using the SELECT query with PHP. However, the same exact query yields results in alternative clients, namely SQLBuddy and the likes. Everything is encoded in UTF-8. Code <?php $host = "localhost"; $username = "hans_wehr_client"; // i know my security is a joke :) $password = "hans_wehr"; $database = "hans_wehr"; $conn = new mysqli($host, $username, $password, $database); if ($conn == TRUE){ $search = $_GET[

pdfkit Browser - “Uncaught ReferenceError: fs is not defined” when using custom fonts

浪子不回头ぞ 提交于 2019-12-11 17:29:12
问题 This question may be asked previously but they have no answer. I try to create a pdf file using pdfkit library with Arabic language support. So, first I downloaded a prebuilt version of pdfkit (which is assumed to work in browser) from here. Then I wrote this code for adding an Arabic font (like in the docs) const doc = new PDFDocument; var text_arabic = "مرحبا مَرْحَبًا"; // Using a TrueType font (.ttf) doc.font('./trado.ttf') // --> this line gives the error. .text(text_arabic) .moveDown(0