Question
Wipro
IN
Last activity: 15 Aug 2017 15:40 EDT
How to remove hidden special characters in a property
Hi,
This is a production issue. A user has copied a text from a resource and pasted it in the text box.But the same text was saved with a special character in the database. Even when we call a soap service/JMS, the same value with a special character is getting passed in the request xml. But it is not present in the clipboard. How to remove these type of spl characters before we save the object to database or calling a service or JMS?
Here is the example
Value in the Front End:
ClipBoard Property Value:
Value stored in the DB:
RYANS EXPRESS FREIGHT INCORPO
Hi,
This is a production issue. A user has copied a text from a resource and pasted it in the text box.But the same text was saved with a special character in the database. Even when we call a soap service/JMS, the same value with a special character is getting passed in the request xml. But it is not present in the clipboard. How to remove these type of spl characters before we save the object to database or calling a service or JMS?
Here is the example
Value in the Front End:
ClipBoard Property Value:
Value stored in the DB:
RYANS EXPRESS FREIGHT INCORPO
Value passed in the SOAP request xml:
RYANS EXPRESS FREIGHT INCORPO
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Virtusa Consulting UK
GB
Wipro
IN
Since this is an issue in prod, we are not sure from which source the user has copied the text. We are waiting for the response from the user.
Virtusa Consulting UK
GB
And, I don't see a special character in any of the values you have given? (unless you tell us that the pipe symbol at the start of the value in the clipboard is a special character)
Wipro
IN
Thanks Kautukshet for responding. Please see an additional " ' " in the below text. But it is not present in the clipboard.
RYANS EXPRESS FREIGHT INCORPO
ClipBoard value : RYANS EXPRESS FREIGHT INCORPO
Virtusa Consulting UK
GB
Can you try to use the function truncate before sending the value? or before saving the instance?
Wipro
IN
I tried but, the property does not has the character at that time.
Capgemini
IN
You can use regex to remove the special chars from the input using a function.
Ref: https://stackoverflow.com/questions/20731966/regex-remove-all-special-characters-except-numbers
-Saikat
Wipro
IN
Here the hidden character is . But if the user enters this character using keyboard, then we should not remove this character from the string.
Pegasystems Inc.
US
Can you be more clear about your requirements? Are you trying to remove the special character only when you receive this kind of data via JMS, but not if the user enters it via keyboard?
What processing are you doing on this data to remove apostrophies right now?
Intellativ
US
Use 'removeSpecialChars' rule utility function to remove any special characters in your string.
-
Alfonso Escobar