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 8581505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:04:05+00:00 2026-06-11T21:04:05+00:00

I have a form (struts 1) that is being validated and during the validation

  • 0

I have a form (struts 1) that is being validated and during the validation I have been asked to remove MS Word’s curly single and double quote marks. Seems like such a simple request and I am tearing my hair out over it.

My test text is ’ “ ”.

First of all, I found that when I run my code in the debugger and watch what IntelliJ thinks the values are, it displays â\u0080\u0099 â\u0080\u009C â\u0080\u009D and it seems that â\u0080 are nonprinting characters.

I used a piece of code that iterates over a StringBuilder of the text in the field and tests each char in the text. It replaces or deletes some chars, as below:

switch (origCharAsInt) {

    case ((int)'\u00C2'): sbOriginal.deleteCharAt(isb); break; // weird Word A with the caret over it
    case ((int)'\u00C3'): sbOriginal.deleteCharAt(isb); break; // weird Word A with the tilde over it
    case ((int)'\u00E2'): sbOriginal.deleteCharAt(isb); break; // weird Word a with the caret over it

    case ((int)'\u0099'): sbOriginal.setCharAt(isb, '\''); break; // Word single quote
    case ((int)'\u009C'): sbOriginal.setCharAt(isb, '"'); break; // Word left double quote
    case ((int)'\u009D'): sbOriginal.setCharAt(isb, '"'); break; // Word right double quote

    case ((int)'\u2018'):  sbOriginal.setCharAt(isb, '\''); break;  // left single quote
    case ((int)'\u2019'):  sbOriginal.setCharAt(isb, '\''); break;  // right single quote
    case ((int)'\u201A'):  sbOriginal.setCharAt(isb, '\''); break;  // lower quotation mark

    case ((int)'\u201C'):  sbOriginal.setCharAt(isb, '"'); break;  // left double quote
    case ((int)'\u201D'):  sbOriginal.setCharAt(isb, '"'); break;  // right double quote
    case ((int)'\u201E'):  sbOriginal.setCharAt(isb, '"'); break;  // double low quotation mark

    case ((int)'\u2039'):  sbOriginal.setCharAt(isb, '\''); break;  // Single Left-Pointing Quotation Mark
    case ((int)'\u203A'):  sbOriginal.setCharAt(isb, '\''); break;  // Single right-Pointing Quotation Mark

    default: break;

}

This seems to work, in that it replaces some of the more egregious cruft, and the form now appears to contain ' " ". If I then save again, though, the IntelliJ thinks the field contains Â\u0080 Â\u0080\" Â\u0080\".

So I added a few more cases to remove those  characters. But I’m flummoxed by the persistence of the \u0080 characters.

I tried adding in a few more cases to try to remove them, but they did not work.

case ((int)'\u0080'): sbOriginal.deleteCharAt(isb); break; // another weird Word non-printing char
case ((int)'\u0082'): sbOriginal.deleteCharAt(isb); break; // another weird Word non-printing char
case ((int)'\u0083'): sbOriginal.deleteCharAt(isb); break; // another weird Word non-printing char
case ((int)'\u0000'): sbOriginal.deleteCharAt(isb); break; // why are these weird symbols showing up?

Any help/explanation would be greatly appreciated.

  • 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-11T21:04:06+00:00Added an answer on June 11, 2026 at 9:04 pm

    You need to escape HTML properly. Unicode isn’t the answer here. This link is your jam.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a struts form that contains many input fields generated using indexed properties.
I have a struts application that has a form to edit user details. I
I have a web application that is made with Java+Struts. There is a form
In a Struts 1.x application, I have a form with a simple single-selection html:select
I have the following form in a Struts2 JSP that contains some radio buttons.
I have a form in struts 1.3 which is dynamically generated one and having
I have a j2ee web application running on struts. I am using validation XMLs
I have a form with a field that may have zero to multiple values
I have a simple form that I don't want accidentally submitted multiple times. I
I have a simple jsp form that the customer uses to send us emails.

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.