Rescator wrote:Don't people realize that an ascii string can be stored in a unicode string? *shakes head*
RealBasic has two simple functions that make this very easy, PB equivalents might look like this:
Code: Select all
InternalString$ = DefineEncoding(IncomingData$,#PB_UTF8) ; for data being read into the program
DataToExport$ = ConvertEncoding(InternalString$,#PB_UTF8) ; to output data in the correct format
I'm assuming from what you've said this should also be achievable in PB.
It's been a very long time since I've used PB (it's really SpiderBasic that's got me interested again), last night I was trying to figure out how you'd achieve the above and to be honest I'm still not sure. I've also read both threads about Fantaisie dropping support for ascii compilation and there's been talk of Buffers, Peeking, Poking, Pointing and pseudo-types... it all sounds horribly complicated compared to the two commands I'm used to.
Are strings in SpiderBasic UTF8? If there's going to be an inconsistency between the strings in PB and SB it would be even more helpful if the commands for handling encodings were as simple as possible.