473,322 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Hebrew support -- please help !

Hi all,

I develop an application (JAVA/JSP) on RedHat PostgreSQL 7.4.3 with PostgreSQL 7.4.2 JDBC3 with SSL (build 213).

This application needs to serve pages in LATIN1 and Hebrew.
For that I create 2 Databases, one DB in UNICODE encoding with client encoding LATIN1 when in the JSP the charset encoding is iso-8859-1 and it's working fine from client to server and server to client.

so I decide to do the same thing with Hebrew -- DB in UNICODE with client encoding ISO-8859-8 when in the JSP the charset encoding is iso-8859-8, then I got strange characters.

I also tried to create DB in UNICODE encoding with client encoding UNICODE when in the JSP the charset encoding is UNICODE, but same problem I got strange characters.

Does someone have a solution or a way to resolve this problem.

Elie
---------------------------------
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
Nov 23 '05 #1
7 2785
> Hi all,

I develop an application (JAVA/JSP) on RedHat PostgreSQL 7.4.3 with PostgreSQL 7.4.2 JDBC3 with SSL (build 213).

This application needs to serve pages in LATIN1 and Hebrew.
For that I create 2 Databases, one DB in UNICODE encoding with client encoding LATIN1 when in the JSP the charset encoding is iso-8859-1 and it's working fine from client to server and server to client.

so I decide to do the same thing with Hebrew -- DB in UNICODE with client encoding ISO-8859-8 when in the JSP the charset encoding is iso-8859-8, then I got strange characters.

I also tried to create DB in UNICODE encoding with client encoding UNICODE when in the JSP the charset encoding is UNICODE, but same problem I got strange characters.

Does someone have a solution or a way to resolve this problem.


If I understand correctly, JDBC driver issues "set client_encoding to
iso-8859-8" in your case. You should check it first. If it does the
right thing, then you might want to the conversion maps. They are located:

src/backend/utils/mb/Unicode/utf8_to_iso8859_8.map // UNICODE(UTF-8) -> ISO-8859-8
src/backend/utils/mb/Unicode/iso8859_8_to_utf8.map // ISO-8859-8 -> UNICODE(UTF-8)

If you find anything wrong, please let me know.
--
Tatsuo Ishii

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #2
Hi Elie,
I develop an application (JAVA/JSP) on RedHat PostgreSQL 7.4.3 with
PostgreSQL 7.4.2 JDBC3 with SSL (build 213). This application needs to serve pages in LATIN1 and Hebrew.
For that I create 2 Databases, one DB in UNICODE encoding with client
encoding LATIN1 when in the JSP the charset encoding is iso-8859-1 and
it's working fine from client to server and server to client. so I decide to do the same thing with Hebrew -- DB in UNICODE with client
encoding ISO-8859-8 when in the JSP the charset encoding is iso-8859-8,
then I got strange characters. I also tried to create DB in UNICODE encoding with client encoding UNICODE
when in the JSP the charset encoding is UNICODE, but same problem I got
strange characters. Does someone have a solution or a way to resolve this problem.


Are you sure your client side display and fonts are set correctly? Can you look at the ASCII codes you get back from Postgres to make sure they are not the correct Hebrew characters. You can send me some strings you got by email and I'll look at it if you want.

Bye,

Guy.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #3
Hi Elie,

actually it is much simpler if you use Unicode encoding on both sides.
Anyway, where do you see the strange characters? If you look at your DB
through commandline psql it is crucial to have the correct encoding.

I use to work on the commandline of my Linux box. I log in via putty,
which on a Win98 Machine is not capable of displaying unicode characters
correctly.

Ulrich
--
------------------------------------------------------------
Relevant Traffic AB, Riddargatan 10, 11435 Stockholm, Sweden
Tel. +46-8-6789750 http://www.relevanttraffic.se
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #4
Hi Guy,
Are you sure your client side display and fonts are set correctly?
Yes, I can display Hebrew font.
Can you look at the ASCII codes you get back from Postgres to make sure they are not the correct Hebrew characters.


I use pgAdmin3 on W2K to insert row in Hebrew and can see the right character.

My /etc/sysconfig/i18n file:
LANG="en_US.UTF-8"
SUPPORTED="fr_FR.UTF-8:fr_FR:fr:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"

Now I tried this configuration:
* DB in UNICODE, 'set client_encoding to UNICODE'
* Apache 2.0 + mod_jk2: don't see any encoding
* Tomcat 5: javaEncoding to UTF8 (default value)
* In each JSP:
<%@ page contentType="text/html;charset=utf-8" language="java"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Now I got the right information from the DB in Hebrew and french.
Still can't save value in Hebrew from client (browser) to server and in french if I save 'été' in a column varchar(3) I got a range over exception.

What happen here ! something else to config ?

Elie
---------------------------------
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
Nov 23 '05 #5
> Now I got the right information from the DB in Hebrew and french.
Still can't save value in Hebrew from client (browser) to server and
in french if I save 'été' in a column varchar(3) I got a range over
exception.

What happen here ! something else to config ?
This is a Tomcat question...

When processing forms set the encoding of the form element using the
following attribute (in addition to all that you are doing):

enctype= "text/plain;charset=UTF-8"

eg <form action="blah" ... enctype= "text/plain;charset=UTF-8">

Also add a hidden field with special/accented characters in all your
forms. Query the parameter value (of the hidden field) in your
servlet/filter/jsp to see what you actually got. It could be that the
browser didn't respect your encoding, and you don't get back what you
put there in the first place!

Hope that helps.

John Sidney-Woollett

Elie Nacache wrote:
Hi Guy,

Are you sure your client side display and fonts are set correctly?

Yes, I can display Hebrew font.

Can you look at the ASCII codes you get back from Postgres to make sure they are not the correct Hebrew characters.

I use pgAdmin3 on W2K to insert row in Hebrew and can see the right character.

My /etc/sysconfig/i18n file:
LANG="en_US.UTF-8"
SUPPORTED="fr_FR.UTF-8:fr_FR:fr:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"

Now I tried this configuration:
* DB in UNICODE, 'set client_encoding to UNICODE'
* Apache 2.0 + mod_jk2: don't see any encoding
* Tomcat 5: javaEncoding to UTF8 (default value)
* In each JSP:
<%@ page contentType="text/html;charset=utf-8" language="java"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Now I got the right information from the DB in Hebrew and french.
Still can't save value in Hebrew from client (browser) to server and in french if I save 'été' in a column varchar(3) I got a range over exception.

What happen here ! something else to config ?

Elie
---------------------------------
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #6
Hi Elie,
Now I got the right information from the DB in Hebrew and french.
Still can't save value in Hebrew from client (browser) to server and in
french if I save 'été' in a column varchar(3) I got a range over exception.


you are working through the web. That makes the whole thing a lot more
complex. Try to use UTF-8/UNICODE encoding all the way. That means
configure Apache(!!!) and Tomact to server pages in UTF-8 encoding.
All web pages pages should have

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Check in your browser if UTF-8 encoding is used. On the other operating
system in IE use View > Encoding, it should show UTF-8.

Actually the browser to server communication is the hardest to ensure
the right encoding is used.

We have a database with Japanese, Hebrew, German, Swedish, French,
Spanish and English content.

Ulrich

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #7
Hi Ulrich

Finally I resolve the problem.

Here is the solution:
DB server side:
===========
* DB encoding UNICODE
* DB client encoding UNICODE

JSP side:
=======
* <%@ page contentType="text/html;charset=UTF-8" language="java"%>
* <%@ page pageEncoding="ISO-8859-1"%>
* request.setCharacterEncoding("UTF-8");
* <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Tomcat side: (server.xml file)
=========
<Connector port="8009" enableLookups="false" redirectPort="8443" debug="0"
protocol="AJP/1.3" URIEncoding="UTF-8"/>

For those that use a property bunle file (key/value) you need to save this file in
ISO-8859-1. if you have unicode characters in it you have to convert the file with native2ascii tool.

Thanks to all,
Elie
---------------------------------
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
Nov 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mr. x | last post by:
Hello, I am building a web-site. For a reason, I don't know why, if I put my site on my computer - I see hebrew character fine, but when I put my site on hosting company I don't see hebrew...
2
by: Ben Kayam | last post by:
Hello, I have a hebrew string that include numbers and other letters, i need to revere only the hebrew fonts. somebody told me using the bidi. please help me.
0
by: Julia | last post by:
Hi, I am trying to POST values from WINFORM application to ASP(not ASP.NET) page,which save them in ACCESS data base(support unicode) The values contains Hebrew and English characters no...
0
by: Sim Zacks | last post by:
I read the recent posts about Hebrew support already and I am having a similar problem, but with an MS Access front end. The database is Unicode encoded. I can input Hebrew, query in hebrew and...
6
by: David Thielen | last post by:
Hi; I understand that HTMLDirectionality sets the direction for the <html> tag. But what about text within the page, especially text that is mixed (rtl and ltr)? Doesn't it need the <span...
40
by: Shmuel (Seymour J.) Metz | last post by:
I'd like to include some Hebrew names in a web page. HTML 4 doesn't appear to include character attributes for ISO-8859-8. I'd prefer avoiding numeric references, e.g.,...
1
by: Souloron | last post by:
Here what I did: string cmdText = String.Format(("CREATE TABLE {0} (dno int primary key, Sunday char(5), Monday char(5), Tuesday char(5), Wednesday char(5), Thursday char(5),...
2
by: Mitul | last post by:
Hello Friend, I am having very strange problem with mail function. As I have to implement Newsletter things in my hebrew site. I have implemented everything but having problem with subject line...
4
by: ofiras | last post by:
Hi everyone, I made a web page in PHP, and included in it PHP file, which prints Hebrew text. I used the web page to include other files, but only this particular PHP file makes my Hebrew look...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.