arabic

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()

Jupyter misdisplying Python lists with Arabic and alphanumeric elements

爱⌒轻易说出口 提交于 2021-01-28 08:34:05
问题 I am running into a display problem in Jupyter (both Classic and JupyterLab) for lists that include Arabic string elements and Latin Alphanumeric string elements. For example, if you run: en = '7X' print (en) ar = 'عربي' print (ar) print ([en, ar]) print ([ar, en]) Here is what you get: Obviously, where Arabic is the first element, Jupyter follows an RTL alignment displaying the ar element first on the right, but I don't know why the 'X' jumps from the alphanumeric element or how to fix that.

Outline effect to text in Arabic using CSS

左心房为你撑大大i 提交于 2021-01-28 04:19:43
问题 I want to add an outline to text that works well in Arabic. One possible solution is to use text-stroke : body { background-color: pink; } h1 { color: white; text-align: center; -webkit-text-stroke: 1px black; text-stroke: 1px black; } <h1>Experiment</h1> <h1>تجربة</h1> This is how it renders for me: As you can see, this works well in English, but not in Arabic. In Arabic, letters are often connected to each other, and the outline should not appear between connected letters. To quote W3: When

Rails friendly_id with arabic slug

主宰稳场 提交于 2021-01-28 03:05:43
问题 My question is closely related to this one Rails friendly id with non-Latin characters. Following the suggested answer there, I implemented a little bit different solution (I know, it's primitive, but I just want to make sure it works before adding complex behavior). In my user model I have: extend FriendlyId friendly_id :slug_candidates, :use => [:slugged] def slug_candidates [ [:first_name, :last_name], [:first_name, :last_name, :uid] ] end def should_generate_new_friendly_id? first_name

Android convert Arabic number to English Number

对着背影说爱祢 提交于 2021-01-21 08:24:52
问题 I get the following error from the gps: Fatal Exception: java.lang.NumberFormatException Invalid double: "-٣٣٫٩٣٨٧٤" Now this is from a error that I got from a user via Fabric. It looks like arabic so I'm guessing it only happens if you have the language set to that, or your sim card? Is it possible to force the gps to send characters in the 0-9 range? Or can I somehow fix this? 回答1: Try this: String number = arabicToDecimal("۴۲"); // number = 42; private static final String arabic = "\u06f0

Android convert Arabic number to English Number

人盡茶涼 提交于 2021-01-21 08:22:12
问题 I get the following error from the gps: Fatal Exception: java.lang.NumberFormatException Invalid double: "-٣٣٫٩٣٨٧٤" Now this is from a error that I got from a user via Fabric. It looks like arabic so I'm guessing it only happens if you have the language set to that, or your sim card? Is it possible to force the gps to send characters in the 0-9 range? Or can I somehow fix this? 回答1: Try this: String number = arabicToDecimal("۴۲"); // number = 42; private static final String arabic = "\u06f0

is there any way to start my Arabic text from right to left when export as PDF

一世执手 提交于 2021-01-01 00:02:52
问题 I am using Apache FOP 2.2 to Export as PDF. I want my arabic text to start from right to left. If i give text alignment as Right all characters are going to right end of the screen which is causing alignment issue in my pdf. Code: <fo:block font-size="2.5mm" font-weight="bold" text-align="left" white-space="normal" margin="1.5mm" xsl:use-attribute-sets="CustomStyles-ar"> الآن لحضورHarishالمؤتمر </fo:block> Arabic text should start from right to left instead it is starting from left to right:

Arabic characters in URL while sharing on Twitter

荒凉一梦 提交于 2020-12-08 05:34:12
问题 I'm facing an issue trying to sharing an URL which includes arabic characters on Twitter: http://example.com/قرعة-تصفيات-أفريقيا-مصر-تواجه-نيجيريا/ When i click on "share" the same URL is showed in the tweet box, but when I actually tweet, it just links to http://example.com , and the rest of the URL is lost. I tried using urlencode() , but the generated URL is too long and impossible tweet. How could I solve this? 回答1: If you are owner of website, you can write htaccess RewriteRule for

Arabic characters in URL while sharing on Twitter

Deadly 提交于 2020-12-08 05:31:19
问题 I'm facing an issue trying to sharing an URL which includes arabic characters on Twitter: http://example.com/قرعة-تصفيات-أفريقيا-مصر-تواجه-نيجيريا/ When i click on "share" the same URL is showed in the tweet box, but when I actually tweet, it just links to http://example.com , and the rest of the URL is lost. I tried using urlencode() , but the generated URL is too long and impossible tweet. How could I solve this? 回答1: If you are owner of website, you can write htaccess RewriteRule for