• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Character encoding

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Correct me if i am wrong.

When user servlet does not set character encoding then

a . servlet uses default encoding ( ISO-8859-1 )
b. servlets do not set the character encoding to ISO-8859-1 , its still null both a & b are correct , right ??

some one please confirm this
 
Vinod Iyer
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ranchers help !!
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Vinod Iyer:
Correct me if i am wrong.

When user servlet does not set character encoding then

a . servlet uses default encoding ( ISO-8859-1 )
b. servlets do not set the character encoding to ISO-8859-1 , its still null both a & b are correct , right ??

some one please confirm this



The default encoding of a request and response is "ISO-8859-1" if it was not set by the client request and the servlet programmer, respectively.

However, in the request, getCharacterEncoding() returns null if the encoding was not set by the client request.
and in the response, getCharacterEncoding() will return "ISO-8859-1" if this was not set.

So I'd say that A is correct if you replace "servlet" with request and response, and
B is correct only if you replace "sservlet" with request.
 
Vinod Iyer
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks...
reply
    Bookmark Topic Watch Topic
  • New Topic