Android Question Show Spanish characters in WebView

eladroz

Member
Licensed User
Longtime User
Hello,

I am trying to show Spanish characters in a WebView.
The HTML code have some keywords (for example @@ClientName@@, @@CurrentDate@@, etc) which being replaced with actual data from the database. While running, it did not pick the Spanish characters even though it saved correctly into the database, so I tried to work with String variable instead of Byte and suSubString2 but the process was extremely slow.

Please help me...

Thanks,
Elad.

Here is my code:

Dim LetterRS As Cursor
Dim LetterBodyItems() As Byte
Dim LetterStringBuilder As StringBuilder
Dim KeywordStringBuilder As StringBuilder

LetterBodyItems = TempLetterBodyItems.StringToBytes(LetterRS.GetString("LetterBody"), "ISO-8859-1")

LetterStringBuilder.Initialize

For CountIndex = 0 To (LetterBodyItems.Length - 1)
If CountIndex > 1 Then
If Chr(LetterBodyItems(CountIndex)) = "@" AND Chr(LetterBodyItems(CountIndex + 1)) = "@" Then
' Keyword starts here
CountIndex = CountIndex + 2
KeywordStringBuilder.Initialize

If CountIndex <= LetterBodyItems.Length - 1 Then
Do Until (Chr(LetterBodyItems(CountIndex)) = "@" AND Chr(LetterBodyItems(CountIndex + 1)) = "@") OR CountIndex > (LetterBodyItems.Length - 1)
KeywordStringBuilder.Append (Chr(LetterBodyItems(CountIndex)))
CountIndex = CountIndex + 1
Loop

LetterStringBuilder.Append(GetKeywordValue(KeywordStringBuilder.ToString))

CountIndex = CountIndex + 1

Else
LetterStringBuilder.Append(Chr(LetterBodyItems(CountIndex)))

End If

Else
LetterStringBuilder.Append(Chr(LetterBodyItems(CountIndex)))

End If

Else
LetterStringBuilder.Append(Chr(LetterBodyItems(CountIndex)))

End If

Next

LetterBody = LetterStringBuilder.ToString

webLetter.LoadHtml(LetterBody)
 
Top