aspjson icon indicating copy to clipboard operation
aspjson copied to clipboard

Why string values are always trimmed? My workaround:

Open websystems-dev opened this issue 3 years ago • 0 comments

Hi all. When we load data from a string with loadJson() or we are displaying data with JSONoutput(), all processed strings are always trimmed. Is this a wanted behavior? In my case, no. This was an issue, because my app wants to receive the complete value, even if it begins/ends with spaces. So I found that aj_JSONEncode() and aj_JSONDecode() always trim strings. Solution: I made a copy of these 2 functions - dropping the trim() - and I replaced them in getJSONValue() and WriteValue(). Now string values are added/readed without trimming.

websystems-dev avatar Jul 04 '21 11:07 websystems-dev