Found an issue in SpiderBasic ? Please report it here !
morosh
 
Posts: 23
Joined: Mon Feb 02, 2015 7:48 pm

Unicode coding differs between SB and PB

by morosh Wed Dec 18, 2019 2:54 pm

Hello:
I noticed that Unicode coding differs from PB to SB:

code PB:
Code: Select all
OpenFile(0,"test.txt", #PB_Unicode)
WriteString(0,"ABCDEF", #PB_Unicode)
CloseFile(0)

this gives the following hexadecimal view: 41 00 42 00 43 00 44 00 45 00 46 00 A.B.C.D.E.F.

code SB:
Code: Select all
file = CreateFile(#PB_Any,"test.txt",0,#PB_Unicode)
If file
  WriteStringN(file,"ABCDEF",#PB_Unicode)
  ExportFile(file, "text/plain")
  CloseFile(file)
EndIf

with an hexadecimal view of: 00 41 00 42 00 43 00 44 00 45 00 46 00 0A .A.B.C.D.E.F

it seems that one uses BigEndian and the other LittleEndian

is this intentional?

I need in SB to read a file made by PB, how to?

Thanks
Fred
Site Admin
 
Posts: 1207
Joined: Mon Feb 24, 2014 10:51 am

Re: Unicode coding differs between SB and PB

by Fred Tue Dec 24, 2019 8:25 am

Looks like a bug to me. Moved.
morosh
 
Posts: 23
Joined: Mon Feb 02, 2015 7:48 pm

Re: Unicode coding differs between SB and PB

by morosh Tue Dec 24, 2019 11:02 am

Thank you, Fred
Return to Bugs Reports

Who is online

Users browsing this forum: No registered users and 0 guests