"Raymond DeCampo" <> wrote in message
news:aRuBf.114692$.. .
> gk wrote:
>> code:
>>
>> i see a JSP which has
>>
>> <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
>>
>>
>> when do i use "pageEncoding="UTF-8" ?
>>
>> .....and when do i skip it ?
>>
>> is it a optional parameter ?
>>
>
> It is optional. Use it to specify what encoding is used when converting
> characters to bytes when sending the response to the browser. In most
> cases you do not care about this, but the times when you do, you really
> care. 
>
> Seriously, if you are sticking with ASCII characters you should be fine.
> Issues arise when you start using international (from the U.S. viewpoint)
> characters.
If you know you are using the US ASCII encoding, you should probably
specify so (pageEncoding="us-ascii"). There exists encodings for which the
glyph a certain character code maps to is different from the glyph in
US-ASCII.
If you have no idea what encoding you're using, I recommend omitting the
attribute altogether, so as to allow the user's browser try to automatically
guess the encoding (or let the user manually set the encoding).
- Oliver