10 Replies - 1446 Views - Last Post: 01 July 2008 - 03:58 PM Rate Topic: -----

#1 HowdeeDoodee   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 78
  • Joined: 17-June 08

Hebrew Characters Not Showing In Php From MySql

Posted 28 June 2008 - 03:12 AM

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.

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.
Is This A Good Question/Topic? 0
  • +

Replies To: Hebrew Characters Not Showing In Php From MySql

#2 MitkOK   User is offline

  • D.I.C Regular
  • member icon

Reputation: 33
  • View blog
  • Posts: 403
  • Joined: 09-August 07

Re: Hebrew Characters Not Showing In Php From MySql

Posted 28 June 2008 - 04:54 AM

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


PS: I assume that you use MySQL.

This post has been edited by MitkOK: 28 June 2008 - 05:01 AM

Was This Post Helpful? 0
  • +
  • -

#3 HowdeeDoodee   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 78
  • Joined: 17-June 08

Re: Hebrew Characters Not Showing In Php From MySql

Posted 28 June 2008 - 06:57 AM

Thank you for your response.

I put the query statement just above the Select statement.

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.
Was This Post Helpful? 0
  • +
  • -

#4 JBrace1990   User is offline

  • D.I.C Addict
  • member icon

Reputation: 112
  • View blog
  • Posts: 760
  • Joined: 09-March 08

Re: Hebrew Characters Not Showing In Php From MySql

Posted 28 June 2008 - 11:29 AM

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

http://giladlotan.com/blog/?p=270
Was This Post Helpful? 0
  • +
  • -

#5 HowdeeDoodee   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 78
  • Joined: 17-June 08

Re: Hebrew Characters Not Showing In Php From MySql

Posted 28 June 2008 - 02:02 PM

Thank you for the input.

I have made the following changes with no effect.

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


after
default_charset = "utf-8"


Reset collation of the Text field to utf8_bin

Also...
//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.
Was This Post Helpful? 0
  • +
  • -

#6 HowdeeDoodee   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 78
  • Joined: 17-June 08

Re: Hebrew Characters Not Showing In Php From MySql

Posted 28 June 2008 - 09:21 PM

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.

<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.findthepo...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.
Was This Post Helpful? 0
  • +
  • -

#7 JBrace1990   User is offline

  • D.I.C Addict
  • member icon

Reputation: 112
  • View blog
  • Posts: 760
  • Joined: 09-March 08

Re: Hebrew Characters Not Showing In Php From MySql

Posted 29 June 2008 - 08:12 AM

yes... I end up seeing:

Text The original term תהו tohu and בהו bohu,
Was This Post Helpful? 0
  • +
  • -

#8 Guest_ch__*


Reputation:

Re: Hebrew Characters Not Showing In Php From MySql

Posted 29 June 2008 - 12:04 PM

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

And in HTML:
<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.
Was This Post Helpful? 0

#9 HowdeeDoodee   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 78
  • Joined: 17-June 08

Re: Hebrew Characters Not Showing In Php From MySql

Posted 29 June 2008 - 06:13 PM

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.

<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?
Was This Post Helpful? 0
  • +
  • -

#10 Guest_ch__*


Reputation:

Re: Hebrew Characters Not Showing In Php From MySql

Posted 30 June 2008 - 02:01 AM

View PostHowdeeDoodee, on 30 Jun, 2008 - 04:13 AM, said:

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.
Was This Post Helpful? 0

#11 HowdeeDoodee   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 78
  • Joined: 17-June 08

Re: Hebrew Characters Not Showing In Php From MySql

Posted 01 July 2008 - 03:58 PM

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1