Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8575641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:44:23+00:00 2026-06-11T19:44:23+00:00

A coworker of mine created a basic contact-us type form, which is mangling accented

  • 0

A coworker of mine created a basic contact-us type form, which is mangling accented characters (è, é, à, etc). We’re using KonaKart a Java e-commerce platform on Struts 1.

I’ve narrowed the issue down to the data coming in through the HttpServletRequest object. Comparing a similar (properly functioning) form, I noticed that on the old form the request object’s Character Encoding (request.getCharacterEncoding()) is returned as “UTF-8”, but on the new form it is coming back as NULL, and the text coming out of request.getParameter() is already mangled.

Aside from that, I haven’t found any significant differences between the known-good form, and the new-and-broken form.

Things I’ve ruled out:

  • Both HTML pages have the tag: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  • Both form tags in the HTML use POST, and do not set encodings
  • Checking from Firebug, both the Request and Response headers have the same properties
  • Both JSP pages use the same attributes in the <%@page contentType="text/html;charset=UTF-8" language="java" %> tag
  • There’s nothing remotely interesting going on in the *Form.java files, both inherit from BaseValidatorForm
  • I’ve checked the source file encodings, they’re all set to Default – inherited from Container: UTF-8

If I convert them from ISO-8859-1 to UTF-8, it works great, but I would much rather figure out the core issue.
eg: new String(request.getParameter("firstName").getBytes("ISO-8859-1"),"UTF8")

Any suggestions are welcome, I’m all out of ideas.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:44:24+00:00Added an answer on June 11, 2026 at 7:44 pm

    Modern browsers usually don’t supply the character encoding in the HTTP request Content-Type header. It’s in case of HTML form based applications however the same character encoding as specified in the Content-Type header of the initial HTTP response serving the page with the form. You need to explicitly set the request character encoding to the same encoding yourself, which is in your case thus UTF-8.

    request.setCharacterEncoding("UTF-8");
    

    Do this before any request parameter is been retrieved from the request (otherwise it’s too late; the server platform default encoding would then be used to parse the parameters, which is indeed often ISO-8859-1). A servlet filter which is mapped on /* is a perfect place for this.

    See also:

    • Unicode – How to get the characters right?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A coworker of mine was working on preventing duplicate form submissions (on a successful
A coworker of mine has this problem, apparently after installing Re#, which seems totally
A coworker of mine suggested I avoid using any gradients in my mobile apps
A coworker recently checked in a changeset where lots of expressions on the form
An ex-coworker of mine wrote the following UPDATE as part of a data import
My coworker's installation of visual studio 2008 breaks every time there's an exception, mine
A junior co-worker of mine managed to write very scary, scary code. printJob.Type =
A coworker of mine started with this code: var newList = new List<>(); foreach(var
A coworker of mine was looking through one of our inherited code bases and
A coworker of mine and I were having a discussion today about Linq. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.