1

I have an application (written in Clarion) that accepts user input and that input gets saved to a sql database. Then those records get processed and sent to a server via web service (written in C#). But sometimes the web service gives a bad request exception on text that contains invalid characters and are invisible in sql.

When I copy paste the sql field into notepad++ it shows the 'character'.

invalid chars

We suspect this issue occurs when a user copy and pasted text from Outlook in the input field.

How can I handle this problem? I cant use text.replace as I don't know what to search for in the first place. Is there an all round remove invalid characters from string or a convert to plain text function? But things as carriage return should remain. Some uni-code 16 to uni-code 8 conversion maybe?

A little lost on this one. Thanks

Deon
  • 203
  • 2
  • 4
  • 15
  • Mate have you checked your settings in Notepad++ under 'View > Show Symbol'. You might have the setting "Show All Characters" active. – Dr Schizo Aug 08 '14 at 07:56
  • Nah "Show All Characters" is not checked. If I check it, it shows CR and LF with a black background as well at the end of each record in the table. These however don;t cause any issues as the web service processes records fine if the US part is removed in the database. – Deon Aug 08 '14 at 08:07

1 Answers1

3

US is Unit Separator. This is 0x1f or 31. You may try

REPLACE(yourField,char(31),'')
Giannis Paraskevopoulos
  • 18,261
  • 1
  • 49
  • 69