Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 109,157 PHP Programmers for FREE! Ask your question and get quick answers from experts. There are 1,030 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Hebrew Characters Not Showing In Php From MySql

 
Closed TopicStart new topic

Hebrew Characters Not Showing In Php From MySql

HowdeeDoodee
post 28 Jun, 2008 - 03:12 AM
Post #1


D.I.C Head

**
Joined: 17 Jun, 2008
Posts: 54

Hebrew characters that appear in phpMyAdmin in browse mode do not appear in a php script output.

I have reset the table with the code below.

CODE

Alter Table `Comm_Clarke`
    DEFAULT CHARACTER SET Hebrew COLLATE Hebrew_general_ci;


Can anyone give me suggestions on how to correct this problem?

Thank you in advance for any replies.
User is offlineProfile CardPM

Go to the top of the page


MitkOK
post 28 Jun, 2008 - 04:54 AM
Post #2


D.I.C Regular

Group Icon
Joined: 9 Aug, 2007
Posts: 279



Thanked 9 times

Dream Kudos: 225
My Contributions


Try this before pulling out data from DB :
php
mysql_query("SET NAMES HEBREW");


PS: I assume that you use MySQL.

This post has been edited by MitkOK: 28 Jun, 2008 - 05:01 AM
User is offlineProfile CardPM

Go to the top of the page

HowdeeDoodee
post 28 Jun, 2008 - 06:57 AM
Post #3


D.I.C Head

**
Joined: 17 Jun, 2008
Posts: 54

Thank you for your response.

I put the query statement just above the Select statement.

CODE

mysql_query("SET NAMES HEBREW");
$query = "SELECT * FROM `Comm_2Momma` WHERE `Ref_Ref` LIKE '%$SeeAlso%' AND `Source` = $ACL ORDER BY `Index` ASC";


Previously the php output was:

QUOTE
The original term ??? tohu and ??ᤥ bohu,


Now the out put is...

QUOTE
The original term ?tohu and ᤥ bohu,


Copied from the phpMyAdmin window here is the original text from the Window (don't know if it will show here)
QUOTE
The original term תהו tohu and בהו bohu,


Thank you again for your reply.
User is offlineProfile CardPM

Go to the top of the page

JBrace1990
post 28 Jun, 2008 - 11:29 AM
Post #4


D.I.C Regular

Group Icon
Joined: 9 Mar, 2008
Posts: 422



Thanked 19 times

Dream Kudos: 350
My Contributions


I've never used Hebrew, but I searched google and found this:

http://giladlotan.com/blog/?p=270
User is offlineProfile CardPM

Go to the top of the page

HowdeeDoodee
post 28 Jun, 2008 - 02:02 PM
Post #5


D.I.C Head

**
Joined: 17 Jun, 2008
Posts: 54

Thank you for the input.

I have made the following changes with no effect.

In php.ini
before
CODE
;default_charset = "iso-8859-1"


after
CODE
default_charset = "utf-8"


Reset collation of the Text field to utf8_bin

Also...
CODE

//just added
function utf8_encode($Text)
$Text = addslashes($Text);

//just added
function utf8_decode($Text)
$Text = stripslashes($Text);


Produced this error...
QUOTE

Parse error: syntax error, unexpected T_VARIABLE, expecting '{'


I changed the collation for the Text field to utf8_bin and all the field types went to blob.

Does anyone have any experience with the Hebrew character set?
Thank you in advance for any replies.
User is offlineProfile CardPM

Go to the top of the page

HowdeeDoodee
post 28 Jun, 2008 - 09:21 PM
Post #6


D.I.C Head

**
Joined: 17 Jun, 2008
Posts: 54

I have solved this problem for me but I am not sure about what others see on their machine.

I changed the collation to the text field with the Hebrew characters to collation = utf8_bin

I inserted the following line above the php code.

CODE
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-8-i">


When I loaded the web page with Hebrew characters, I received a message to insert the XPHome disc and install the Hebrew language pack/character set from the install disc. Therefore, I installed the Hebrew language pack.

For me on my machine, I can now see the Hebrew characters in the php page.

Question: Does anyone else see the Hebrew characters in the first record pulled up on this page?

http://www.findthepower.net/CP/CommentaryP...eAlso=Gen%201:1

I have to turn off my graphics because of slow dialup and cannot click on the Insert Link.

Thank you in advance.

User is offlineProfile CardPM

Go to the top of the page

JBrace1990
post 29 Jun, 2008 - 08:12 AM
Post #7


D.I.C Regular

Group Icon
Joined: 9 Mar, 2008
Posts: 422



Thanked 19 times

Dream Kudos: 350
My Contributions


yes... I end up seeing:

Text The original term תהו tohu and בהו bohu,
User is offlineProfile CardPM

Go to the top of the page

ch__
post 29 Jun, 2008 - 12:04 PM
Post #8


New D.I.C Head

*
Joined: 7 Nov, 2007
Posts: 21


My Contributions


To avoid this kind of problems in any language, you should always use utf-8, both in MySQL:
CODE
SET NAMES utf8

And in HTML:
CODE
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

MySQL tables should use utf8_general_ci collation in most cases.

It just so happens that we make tri-lingual websites (English/Russian/Hebrew for that matter), and utf-8 proves to be very stable and surprisingly well-supported coding, on both server- and client-side. Welcome to the 21st century folks, eight-bit encodings are gone.
User is offlineProfile CardPM

Go to the top of the page

HowdeeDoodee
post 29 Jun, 2008 - 06:13 PM
Post #9


D.I.C Head

**
Joined: 17 Jun, 2008
Posts: 54

Thank you very much for the informative response.

My issue was caused by my machine running XP not having the Hebrew Language pack activated or installed. In the case of other users like myself, does the utf8 settings circumvent the installation of the particular language pack? The reason I am asking this question is because I tried using utf8 but still saw question marks in place of the Hebrew characters...that is until I installed the language pack. I was prompted to install the Hebrew language pack by using the following code line.

CODE
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-8-i">


Does a user have to have the Hebrew Language Pack installed to see the Hebrew characters?
User is offlineProfile CardPM

Go to the top of the page

ch__
post 30 Jun, 2008 - 02:01 AM
Post #10


New D.I.C Head

*
Joined: 7 Nov, 2007
Posts: 21


My Contributions


QUOTE(HowdeeDoodee @ 30 Jun, 2008 - 04:13 AM) *

Does a user have to have the Hebrew Language Pack installed to see the Hebrew characters?

Sounds like your MS Windoze lacks Hebrew fonts by default, and in order to see Hebrew glyphs you need at least one Hebrew-enabled font.

This is very OS-specific, e.g. my Linux box (Fedora 9) had nearly everything installed out-of-the-box, Russian, Hebrew, even Chinese, so I never bothered.
User is offlineProfile CardPM

Go to the top of the page

HowdeeDoodee
post 1 Jul, 2008 - 03:58 PM
Post #11


D.I.C Head

**
Joined: 17 Jun, 2008
Posts: 54

Thank you for the comment. I am going to notice the user and tell the user there are Hebrew characters in the text. I will tell the user if the user does not see the Hebrew text to go to the php page with the header line above. Going to a page with the header line above will signal windows to install the Hebrew language pack.

Thank you to all of those on this thread who made contributions. Your time and effort are appreciated.

User is offlineProfile CardPM

Go to the top of the page

Closed TopicStart new topic
Time is now: 9/5/08 05:38PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month