Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Special characters in spring form:textarea are being replaced

Posts: 15
  • 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
Posts: 15
  • 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.
New rule: no elephants at the chess tournament. Tiny ads are still okay.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic