Issue: special characters

Discussion in 'Java' started by Raghu Raman, Jul 15, 2011.

  1. Raghu Raman

    Raghu Raman

    Joined:
    Jul 15, 2011
    Messages:
    1
    Likes Received:
    0
    If one special character (" ' " , " - " ) is pasted from Outlook or some other app and then into our java application and save character with – apprea on the text area on the java application. If again we save the text, the the special characters string might triple again.

    Say user had copied text KHPA DAI – Additional DCG Groups to our java application, when saved and retrived that particular think, this would be seen as KHPA DAI – Additional DCG Groups. When saved the text in the database( Oracle ) its stored as KHPA DAI â?? Additional DCG Groups.


    Here is a simple demonstration.
    The following line contains a dash, a space, an apostrophe and another space, four characters in all.
    – ’
    Paste those four characters into a PIF special instructions on our jsp page. Then repeatedly save and re-query the PIF (without submitting and without making any changes to the data), and watch the size of the field grow:
    1. – ’
    2. – ’
    3. – ’
    4. – ’
    5. – ’



    below is the code snap shot of the textarea field

    String specialInstructions = "";



    <td><textarea rows="3" cols="60" name="specialInstructions" id="specialInstructions" onchange="javascript:assigntempVal();"><%=specialInstructions%>
    </textarea><input type="hidden" name="splInstTemp" id="splInstTemp" value="<%=specialInstructions%>"/>
    </td>

    Appreciate all Java Guru's to help me out with a solution on how to handle these a dash & an apostrophe when entered or copied from other application into the text area of the java application.

    How to handle such situation? :-(


    Regards
    RR
     
    Raghu Raman, Jul 15, 2011
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.