Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Using UTF-8 encoding for jsp textarea field instead HTML encoding

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i want use UTF-8 encoding for my jsp's text area field instead of HTML encoding.
I want to know how to set explicit encoding for a text area content in jsp file.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm pretty sure encoding can only be set for the entire page--but I could be wrong.
 
Sheriff
Posts: 67401
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't. The purpose of the encodings is completely different. UTF-8 is the encoding of the character set -- HTML encoding is to prevent confusion between special markup characters.
 
N Naresh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know how to set different encoding types in jsp
 
N Naresh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please suggest me how to do encoding in jsp
 
Bear Bibeault
Sheriff
Posts: 67401
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

N Naresh wrote:Please suggest me how to do encoding in jsp


Not enough details to answer. Please use complete sentences and tell the details of what you are asking.
 
N Naresh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know how we can encode and decode different characters in jsp.
In my jsp file spaces are getting replaced with  characters, i need to avoid that characters to be replaced for spaces.
I need some help on encoding and decoding different characters in jsp file.
 
Bear Bibeault
Sheriff
Posts: 67401
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that has nothing to do with a textarea or HTML-encoding.

I'd show how you are specifying the encoding in the pages so someone familiar with character set encoding issues can hekp you, and I'd change the topic title to exclude the textarea mention, which is just a red herring.
 
Good night. Drive safely. Here's a tiny ad for the road:
ScroogeXHTML 9.0 - RTF to HTML5 and XHTML converter
https://coderanch.com/t/731949/ScroogeXHTML-RTF-HTML-XHTML-converter
    Bookmark Topic Watch Topic
  • New Topic