Android Question Codepage / encoding

Nizze

Active Member
Licensed User
Longtime User
Hi

Maybe i'm stup......
But i can't find my problem with Swedish letters.
I know this from before but i cant find the solution

If i send from a textbox "ÅÄÖ"
B4X:
        Dim buffer() As Byte
        buffer = DataToSend.GetBytes("ISO-8859-1")
        Astream.Write(buffer)
In my pc i will have the value 229, 228, 246 .
And they are translated into ???

And when i send the same letters between 2 androids i will get "???" insted of "ÅÄÖ"

If i set a breakpoint on this line i can see that the "ÅÄÖ" will have the Value 63, 63, 63
B4X:
    Sub Astream_NewData (Buffer() As Byte)
            Msg = Conv.StringFromBytes(Buffer,"ISO-8859-1")

What is it that i dont do in the right way ??
 

Nizze

Active Member
Licensed User
Longtime User
Are you using B4J on the PC?
Are you using AsyncStreams in prefix mode?
Hi Erel

Yes i'm using AsyncStreams .
But not Prefix mode .

B4X:
Astream.Initialize(In, out, "astream")

And im using dotNet on pc
 
Upvote 0

Nizze

Active Member
Licensed User
Longtime User
Perhaps it won't help, but tried utf-8 instead of iso-8859-1?

Hi

That worked !!

I rewrote my project ( Both Pc and B4A to UTF8 ) and then it works !!
So now my new project has taken a big step forward ..

Thanks for helping out !!

Br
Nisse
 
Last edited:
Upvote 0
Top