Elhanan said:
but i don't want it work this way, i want the browser to detect my
encoding automatically.
i tried to change to UTF-8, but the hebrew i got was gibbrish.
The line that says:
<%@ page contentType="text/html; charset=windows-1255" %>
Is how your browser "automatically" detects the encoding. In other
words, your browser is being TOLD what the encoding is, and it's being told
incorrect information which is why it's receiving giberrish.
My recommendation is that you change that tag to read:
<%@ page contentType="text/html; charset=utf-16" %>
and then, as an additional step, you have to make sure the data you're
outputting actually IS in UTF-16 format. Once the two fields match up, your
browser will be told to expect UTF-16 data, and it actually WILL receive
UTF-16 data, and be able to display it.
If you tell the browser to expect one kind of data, but then send
another, then it's obviously going to be very confused.
- Oliver