Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

page Encoding

Thread view: 
gk - 20 Jan 2006 04:47 GMT
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 ?
Raymond DeCampo - 24 Jan 2006 19:02 GMT
> code:
>
[quoted text clipped - 7 lines]
>
> 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

Signature

This signature intentionally left blank.

Oliver Wong - 24 Jan 2006 19:51 GMT
>> code:
>>
[quoted text clipped - 16 lines]
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.