Displaying Arabic Texts as Image (Problems: arabic chars is reversed?) - PHP
This is a discussion on Displaying Arabic Texts as Image (Problems: arabic chars is reversed?) - PHP ; I had been looking for a solution on how to display arabic characters on an
image using PHP "properly", but could not find yet a solution.
Tried google, and nothing (Maybe the howto is written in arabic, i dont
know).
...
-
Displaying Arabic Texts as Image (Problems: arabic chars is reversed?)
I had been looking for a solution on how to display arabic characters on an
image using PHP "properly", but could not find yet a solution.
Tried google, and nothing (Maybe the howto is written in arabic, i dont
know).
I found http://www.php4arab.org/, but could not understand the chars on how
to join.
Im hoping someone here do know how.
I am able to display and save to mysql (database) the characters (which i
copied and pasted from this site:
http://www.unicode.org/standard/tran...ns/arabic.html)
When i display it on a browser.. i used..
<?php
header("Content-type: text/html; charset=utf-8");
?>
On before saving on a database i do..
SET NAMES 'utf8'
About the fonts, im using Arial Unicode MS.
My problem is, whenever i display arabic characters like this one..
http://unicode.org/standard/translations/arabic.html (from)
* ما هي الشفرة الموحدة "يونِكود" ؟*
On the input box..
<input type="hidden" name="line_1_2" value=" ما هي الشفرة الموحدة "يونِكود" ؟">
Nothing has changed.. But the image generated was..
http://public.axishift.com/arabic_reverse.jpg
And its really weird, its reversing by itself.
Some lines i used to display the text on an image.
imagettftext($background, 8, 0, 18, 140, $black, "fonts/$fonts",
"$line_4");
Please help!
--
Louie Miranda (lmiranda@gmail.com)
http://www.axishift.com
//JSM-W
-
Re: [PHP] Displaying Arabic Texts as Image (Problems: arabic charsis reversed?)
On Tue, October 17, 2006 8:10 pm, Louie Miranda wrote:
> <?php
> header("Content-type: text/html; charset=utf-8");
> ?>
IE doesn't belive in standard headers, so you'll want a META tag as
well, which it DOES trust. I guess Microsoft thinks web Designers
know more about character sets than web Programmers. They may have a
point there... :-)
> My problem is, whenever i display arabic characters like this one..
> http://unicode.org/standard/translations/arabic.html (from)
>
> * ما هي الشفرة الموحدة "يونِكود" ؟*
>
> On the input box..
>
> <input type="hidden" name="line_1_2" value=" ما هي الشفرة
> الموحدة "يونِكود" ؟">
>
> Nothing has changed.. But the image generated was..
> http://public.axishift.com/arabic_reverse.jpg
>
> And its really weird, its reversing by itself.
>
> Some lines i used to display the text on an image.
>
> imagettftext($background, 8, 0, 18, 140, $black, "fonts/$fonts",
> "$line_4");
I have no idea if imagettftext is "aware" of right-to-left and
left-to-right language differences, but something like strrev only for
Unicode might be a viable solution.
If the image is "right" and the INPUT box is "wrong" you can do HTML
attributes for rtl versus ltr, I think.
Not that I really have any clue what I'm talking about here...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?