DECODEURL include "+" from json return

  1. 2 weeks ago

    ronaldo f

    Dec 1 Pre-Release Testers, Xojo Pro Philippines

    Hi Guys,

    I implemented a HANDLEURL event to receive json string.

    I used im data As String = DecodeURLComponent(Request.Entity.DefineEncoding(encodings.UTF8))

    and it returns

    [{"number":"+639234334054","message":"Tst+31","deviceID":1,"userID":"1","groupID":null,"status":"Received","sentDate":"2018-12-02T09:25:53+0800","deliveredDate":"2018-12-02T09:25:53+0800","ID":133}]?

    My concern is at that it puts "+" sign on the part of "message" : Tst+31" where it should be SPACE.

    Anybody know how to fix it?

  2. Tim P

    Dec 2 Pre-Release Testers feedback://46303

    You should not encode the data as a url component.

  3. last week

    ronaldo f

    Dec 3 Pre-Release Testers, Xojo Pro Philippines

    Thanks.

    so what should I need to use?

  4. Derk J

    Dec 3 Pre-Release Testers, Xojo Pro

    The entity should be send and received without urlencode

  5. Phillip Z

    Dec 5 Pre-Release Testers, Xojo Pro Florence, SC

    The properties are a little confusing because I don't recall any other environment calling it "Entity".

    It is the body of the request. The URL is simply a header and URL's are encoded so they can play nicely in your browser URL bar. The only thing that should be URLencoded/URLdecoded are the URL's in the header and not the body (or entity as Xojo calls it).

  6. ronaldo f

    Dec 5 Pre-Release Testers, Xojo Pro Philippines

    DecodeURLComponent(Request.Entity.DefineEncoding(encodings.UTF8).ReplaceAll("+","%20"))

    This solves the problem.

    Thanks Phillip!

or Sign Up to reply!