This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the NodeJS 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
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Special characters in spring form:textarea are being replaced  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I'm having a problem, probably with charsets or spring, and maybe some of you can help me. The page is developed using spring boot for Internet Explorer 8 (yes, I know).

I have a form and a textarea inside it, and when I process the form, the text is missing any accented vowel or special character (like ñ) and replacing it all with the same char, "?". I really don't know why is this, if it's the page charset, the browser or spring. The html code is the following:



And the way the controller process it:



In this code I'm already trying corrections, the final goal is that inside msg.text or mes is a String with all the special characters. If the text is "áèîö eñe []{}" the output is



As you can see the problem is not only the missing special chars, but also that they are translated into the same symbol, so I can't correct this using String.replaceAll (you can see in the code that I actually did this when I thought it only was the "ñ" char, but in the end accented vowels are too being replaced). Apart from this, I tried changing the meta tag from "iso-8859-1" to "UTF-8" but no results so far.

Any advice?

EDIT: I tried it on Chrome and same fail, so most certainly it isn't the browser (go figure, the problem is not IE8)
 
frege fregenal
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved: didn't change all tags with IDO-8859-1 to UTF-8. After triple check, it works fine.
 
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!