Android Question Quoted text in mysql

juanjo3691

Member
Licensed User
Longtime User
Hello, i have a quoted text in a mysql table in latin_spanish_ci. The text in the data base is "Hello" In the web, IE, it appears perfect ("Hello"), but in a label in b4a it appears "
Resume
DATABASE = "
Response.GetString("UTF8") = $quot;
dim m as map = "
text.replace (""", char(34)) = "

Any solution to this problem ?
Thanks to all
 
Last edited:

juanjo3691

Member
Licensed User
Longtime User
When i write label1.text = chr(34) it shows " perfect.
If i write the code Label1.Text.Replace(""", chr(34)) it shows "
 
Upvote 0

juanjo3691

Member
Licensed User
Longtime User
Hello, Ernschd, i use HTTP version 1.36. I think this library is not the problem, because in the database the text appears with " and the httpresponse it shows me what the database have. The problem is that when i make a replace command it seems not to work.
 
Last edited:
Upvote 0

juanjo3691

Member
Licensed User
Longtime User
This is not the perfect solution, but Works:
B4X:
Sub Escapea(str As String)

    Dim i As Int

    Dim str2 As String

    Dim Done As Boolean = False

    Do While Done = False

        i = str.IndexOf(""")

        If i = -1 Then

            Done = True

        Else

            If i = 0 Then

                If str.Length > 6Then

                    str = Chr(34) &  str.SubString (6)

                Else

                    str = Chr(34)

                End If

                Done = False

            Else

                str2 = str.SubString2 (0, i) & Chr(34) & str.SubString (i + 6)

                str = str2

            End If

        End If

    Loop

    return str

End Sub

Really i have completed the function with the same code for & and for '. This are the three characters that give me problems.
The functions Works! What a beautifull world !
 
Last edited:
Upvote 0
Top