• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Problem with single quote using vvIn_Char

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with single quote using vvIn_Char

    I'm having an issue with vvIn_Char. If a string has been copied and pasted into a text field in the browser from another editor (like Microsoft Word or an HTML formatted email), a single quote character comes in via vvIn_Char as unrecognizable. It looks like a square when viewed in debug and in the database. Any idea how to resolve this?


  • #2
    MS Word and other applications use special unicode characters for certain symbols and punctuation, which often won't show as expected when stored in a standard DB2 character field. Always have to be different... :-)

    Below is a listing of some of those special characters:
    Symbol Encoding
    single quotes and apostrophe \u2018\u2019\u201A
    double quotes \u201C\u201D\u201E
    ellipsis \u2026
    dashes \u2013\u2014
    circumflex \u02C6
    open angle bracket \u2039
    close angle bracket \u203A
    spaces \u02DC\u00A0
    A quick and simple way to convert those symbols is with a regex on the front-end. For example, let's say a user has copied this text from MS Word:

    ""

    This is going into a text field with an itemId of userNotes, and the slanted single apostrophe in "We're" is going to cause problems when stored in a standard physical file's character field. Before we send the value to the back end RPG program, we'll have the front end replace the symbol for single quotes/apostrophe with a standard single quote character...

    I'm having issues wrapping the code, so below is an image: SymbolReplace.png
    Last edited by robert.swanson; 10-13-2017, 07:10 AM.

    Comment


    • #3
      I see what you did there. ;-)
      Nice. Thanks Johnny...I'll give this a shot!

      Comment


      • #4
        Update: Worked like a charm. Thanks!!

        Comment

        Working...
        X