Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Character encoding  RSS feed

 
Vinod Iyer
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
ranchers help !!
 
Hunny Lee
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
thanks...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!