Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > page Encoding

Reply
Thread Tools

page Encoding

 
 
gk
Guest
Posts: n/a
 
      01-20-2006
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 ?

 
Reply With Quote
 
 
 
 
Raymond DeCampo
Guest
Posts: n/a
 
      01-24-2006
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.

HTH,
Ray

--
This signature intentionally left blank.
 
Reply With Quote
 
 
 
 
Oliver Wong
Guest
Posts: n/a
 
      01-24-2006

"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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading Text File Encoding and converting to Perls internal UTF-8 encoding sln@netherlands.com Perl Misc 2 04-17-2009 11:22 PM
aspx page encoding z f ASP .Net 3 12-26-2004 07:44 PM
changing JVM encoding; setting -Dfile.encoding doesn't work pasmol@plusnet.pl Java 1 10-08-2004 09:50 PM
Encoding.Default and Encoding.UTF8 Hardy Wang ASP .Net 5 06-09-2004 04:04 PM
encoding problem on ASP .net page =?Utf-8?B?V0VJV0VJV0VJ?= ASP .Net 2 04-16-2004 10:09 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57