Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script generated page does not recognize the hebrew charset

Status
Not open for further replies.

rambleon

Programmer
Mar 6, 2004
130
IL
Hi
My problem is that the charset in the meta tag is not recognized in the page generated from the function below.
I'm using Hebrew in the html page, in the original page with the same meta tag text displays from right to left as it should for charset=iso-8859-8. In the generated html the text is reversed.

function getPrintPage() {
var pp = window.open();
with (pp.document) {
open();
writeln("<html><head>");
writeln("<link rel='stylesheet' type='text/css' href='tlush.css'>");
writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-8"></meta>');
writeln("</head><BODY BGCOLOR='WHITE' TEXT='NAVY'>");
writeln("<P class=newpage>");
writeln("<Table Frame=Box Align='center'><TR><TD>");
writeln(document.getElementById('print1104').innerHTML);
writeln("</TD></TR></TABLE>");
writeln("</p></body></html>");
close();
}
pp.print();
}

Thanks for any help

Rambleon
 

I'm trying to work this one out, but cannot even get hard-coded text to appear right-to-left, as you say should work with the meta tag. This is my test harness:

Code:
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-8"></meta>
</head>
<body>
	the cat sat on the mat
</body>
</html>

Can you post your code that does appear RTL? Personally, I'd find debugging the dynamic code much easier if I could get the hard-coded stuff working first ;o)

Dan
 
Here's the problem:

Click 'Print Me' to activate the script

<FORM name="big" action=" ">
<HTML><HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-8">
<SCRIPT LANGUAGE="Javascript" charset="iso-8859-8">
var b4this = -1;
function getPrintPage() {
var pp = window.open();
with (pp.document) {
open();
writeln("<html><head>");
writeln("<link rel='stylesheet' type='text/css' href='tlush.css'>");
writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-8"></meta>');
writeln("</head><BODY BGCOLOR='WHITE' TEXT='NAVY'>");
writeln("<P class=newpage>");
writeln("<Table Frame=Box Align='center'><TR><TD>");
writeln(document.getElementById('print1104').innerHTML);
writeln("</TD></TR></TABLE>");
writeln("</p></body></html>");
close();
}
pp.print();
}
</SCRIPT>
<STYLE TYPE="text/css">
.newpage{page-break-after:always}
.tlushtop
{ background-image:url('tlushtop.gif');
background-repeat:no-repeat; width:510; height:140;
line-height:10pt; font-family:monospace;
font-size:10pt; background-position:bottom left}
.tlushbot
{ background-image:url('tlushbot.gif');
line-height:8pt; font-family:monospace;
width:510; height:248; font-size:10pt;
background-repeat:no-repeat;
background-position:top left}
select { font-family: monospace;
font-size: 11pt;
color:navy;
}
</STYLE>
</HEAD><BODY BGCOLOR="WHITE" TEXT="NAVY">
<P class=newpage>
<a name='0411'></a>
<Table Frame=Box Align='center'><TR><TD>
<DIV id='print1104'>
<TABLE CLASS ='tlushtop'>
<TBODY><TR><TD><PRE>



0033/1 11/04 ????? ???? 13 ???-??

5267 28/11/02 ???? ???? 2137601/7

???? 14 ???? 2.75 02/80 941428-49/2

.
</PRE></TD></TR></TBODY></TABLE>
<TABLE FRAME=VSides><TBODY><TR><TD><PRE>
375.18 26.20 14.32 ??????
10.94 17.93 0.61 ??????
19.90 17.93 1.11 ??????
241.70 17.93 13.48 ??????
1143.93 17.93 63.80 ??????
77.10 17.93 4.30 ??????
281.00 ??????
2032.22 ?????
1048.91 ???? ?????
120.00 ??????? ???????
16.69 ??????? ???????
37.76 ????.? ???? ?????
</PRE></TD></TR></TBODY></TABLE>
<TABLE CLASS ='tlushbot'>
<TBODY><TR><TD><PRE>
5405.33
31710
10.0
5405.33 156.07 1555
200.26 ?????? ????? 5385
5405.33

356.33

5049.00



11111111111


20-461


5049.00
134017
</PRE></TD></TR></TBODY></TABLE>
</div>
<TD><TD Valign='top' bgcolor='silver'>
<BR>
<center>
<Table border=2 cellpadding=5 Width=80%><tr><th colspan=2>???? ???</th></tr>
<tr><td colspan=2>
<select name='link0411'
onClick='b4this--; location=document.big.link0411.options[document.big.link0411.selectedIndex].value;'>
<option value='#0411' selected>11/2004</option>
<option value='#0410'>10/2004</option>
</select>

</td></tr><tr height=50 ><td>
<Button OnClick='b4this--; window.location="#0410"'>
<Font face='arial' color='maroon'>Previous</Font></Button>
</td><td>
<Button>
<Font face='arial' color='maroon'>&nbsp&nbsp&nbsp&nbsp&nbsp</Font></Button>
</td></tr></table>
<BR><BR><Button OnClick='window.history.go(b4this)'>Exit</Button>
<BR><BR><Button OnClick='getPrintPage()'>Print Me</Button>
</center>
<BR>
</TD></TR></TABLE>
<BR>
<P class=newpage>
<a name='0410'></a>
<Table Frame=Box Align='center'><TR><TD>
<TABLE CLASS ='tlushtop'>
<TR><TD><PRE>


0033/1 10/04 ????? ???? 13 ???-??

5267 28/11/02 ???? ???? 2137601/7

???? 14 ???? 2.75 02/80 941428-49/2

.
</PRE></TD></TR></TABLE>
<TABLE FRAME=VSides><TR><TD><PRE>
186.54 26.20 7.12 ??????
240.62 17.93 13.42 ??????
485.72 17.93 27.09 ??????
136.00 ??????
81.50 ??????? ???????
12.32 ??????? ???????
</PRE></TD></TR></TABLE>
<TABLE CLASS ='tlushbot'>
<TR><TD><PRE>
1142.70
26304
10.0
1142.70 16.00 1198
35.42 ?????? ????? 4895
1142.70

51.42

1091.28



1111111111


20-461


1091.28
134017
</PRE></TD></TR></TABLE>
<TD><TD Valign='top' bgcolor='silver'>
<BR>
<center>
<Table border=2 cellpadding=5 Width=80%><tr><th colspan=2>???? ???</th></tr>
<tr><td colspan=2>
<select name='link0410'
onClick='b4this--; location=document.big.link0410.options[document.big.link0410.selectedIndex].value;'>
<option value='#0411'>11/2004</option>
<option value='#0410' selected>10/2004</option>
</select>

</td></tr><tr height=50 ><td>
<Button OnClick='b4this--; window.location="#0409"'>
<Font face='arial' color='maroon'>?????</Font></Button>
</td><td>
<Button OnClick='b4this--; window.location="#0411"'>
<Font face='arial' color='maroon'>Next</Font></Button>
</td></tr></table>
<BR><BR><Button OnClick='window.history.go(b4this)'><Img src='exits.gif'></Button>
</center>
<BR>
</TD></TR></TABLE>
</BODY></HTML></FORM>

 
Add this to the writeln:
Code:
<style type="text/css">
<!--

body {
        direction: rtl;
        }

-->
</script>

--Chessbot

"In that blessed region of Four Dimensions, shall we linger on the threshold of the Fifth, and not enter therein? Ah, no! [...] Then, yielding to our intellectual onset, the gates of the Sixth Dimension shall fly open; after that a Seventh, and then an Eighth -- --" Flatland, A. Square (E. A. Abbott)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top