Jump to content

Hebrew data left justified in CGI POST


bradborg

Recommended Posts

Hi,When I use the post method to send form data in an IE browser, to a CGI program, via an Apache Server, my Hebrew data is trimmed (left aligned).The form contains some fields containing left-aligned English data and some fields containing right-aligned Hebrew data.When the page is initially dispayed, all is hunky dory.

<td height="20" colspan="50"><!--  Start dependency tag for input field --><!-- RTL TEXT --><input type="text" value="שששגגג" name="_F0764" size="25" maxlength="25" style="text-align:right"><!--  End dependency tag --></td>

However, when the data is posted to the a CGI program via an apache server, I see that the Hebrew data, which should be right-aligned (e.g. padded with spaces on the left) is trimmed, just as the English data.See debug of data as it arrives at CGI program as below:

W2E_SSNID=0106kLe109255106YW2E0947540000010106kLe1092551060001900151060106N106kLe10925510654000001510601060106kLe1092551065400000151060106&_F0181U=&_F0722U=+&_F0737=++abc&_F0764=גגשששג&_F0802U=+&_F0817=gggsss&_F0844=שששגגג&_KEN=Enter&W2E_SELECT=_F0181U&CmdKey=CmdKey                                  

What do I need to change in the HTML, to ensure the Hebrew data is right aligned?Thanks (Shalom)Simon.

Link to comment
Share on other sites

I'm not sure I understand the problem. The problem is because the Hebrew text does not contain spaces padded on the left? Well the English text doesn't contain any spaces padded on the right either, that's just how the browsers send it back. Unless you specifically type spaces and send them, the browser will not pad anything when it sends the request. It will display it however you want, if you want it displayed right-to-left, it can do that, but the data itself does not include any padding, no matter what language the text is in or no matter what character order. Just make sure that when you display the Hebrew text that you use CSS to specify that it reads right-to-left instead of left-to-right.

Link to comment
Share on other sites

Hi,The problem is that the data is stored in the database left justifed for English and right justified for Hebrew.Yes, English data is not padded on the right on arrivla at the CGI program...but that does not matter as when it is moved to the database field it is still left justified.But when I move Hebrew data from the cgi program, not padded on the left, into the database, it ends up left justified...which is wrong.I would prefer the browser, having identified the field as Hebrew somehow (attribue/element), to say...hang on this is Hebrew data, I'd better pass it right justiifed (left padded) to the CGI program.Otherwise, I will have to identify and handle Hebrew data going to the backend differently as to English data.BTW - the Hebrew data must be right justified in the database as other applications use it .Cheers,Simon.

Link to comment
Share on other sites

Well, you can use your CGI script to pad the data for you, but the browser will not pad anything, it just doesn't do that. It doesn't alter the data when it sends it, it sends exactly what data you tell it to without changing it. If you don't tell it to send padded data, it doesn't send padded data. So you should probably modify the CGI script to pad the string to a specific length before you put it in the database, but you also need to make sure that the database will retain that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...