문제

I'm just running a query and forming a JSON string in cfloop.

For some values that are formed within JSON, I see some bogus extra characters at the end. At first, I suspected them to be white spaces or tabs but adding a Trim(name) did not work.

"first_name":"Jon   "

When I copied the string over to Notepad++ and converted it to utf-8, Here is what I am seeing:

"first_name":"Jon  **xA0**"

I am not sure what that xA0 means here. Is there any way to supress this?

Thanks.

도움이 되었습니까?

해결책

Try replacing with this

<cfset lastname = replacelist(lastname, chr(160), '')>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top