iOS Question encodeurl with stringutils

Discussion in 'iOS Questions' started by tufanv, Oct 9, 2018.

  1. tufanv

    tufanv Expert Licensed User

    Hello,

    I want to encodeurl this string to share a text with whatsapp : For example : "Avro / TL"
    The correct encoded string is : "Avro+%2F+TL" but I use the below code but get :

    "Avro+%2F+TL" instead of the above correct encoded url:

    Code:
    txt="Avro / TL"
        txt=su.EncodeUrl(txt,
    "UTF8")
        LogColor(txt,
    Colors.Red)
        
    Dim url As String = "whatsapp://send?text=" & txt
    what am i missing here ?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    "Avro+%2F+TL"
    "Avro+%2F+TL"

    I don't see any difference between the two strings.
     
  3. tufanv

    tufanv Expert Licensed User

    sorry I pasted the wrong log. My code gives this : "Avro%20%2F%20TL" but it must be : "Avro+%2F+TL"
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    %20 is a valid replacement to space. You can replace it to +:
    Code:
    txt=su.EncodeUrl(txt,"UTF8").Replace("%20""+")
     
    tufanv likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice