Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

[MBS] MBS functions, encodings, and Japanese OS (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] Canvas in NSToobarMBS
Next thread: [MBS] iMedia Browser


[MBS] PortAudioMBS slow in instantiating 2   -   Garth Hjelte
  [MBS] MBS functions, encodings, and Japanese OS   -   Garth Hjelte
   Re: [MBS] MBS functions, encodings, and Japanese OS   -   Christian Schmitz
   [MBS] Windows Webcam Progress   -   A. Christopher Rosado

[MBS] MBS functions, encodings, and Japanese OS
Date: 02.04.13 01:12 (Mon, 01 Apr 2013 19:12:15 -0500)
From: Garth Hjelte
Does running a Japanese version of Windows perhaps influence this type of code? (Please don't judge it on why it's written this way, I'm only concerned if it works.)

ThisStr = FileStream.Read(AmtBytes) // I assume the encoding on ThisStr is Nil?
Buff = New MemoryBlock(Len(ThisStr)) // Len should work, since ThisStr should be Nil
Buff.SetStringMBS(XStr, 0) // the memoryblock should be byte-byte just like what was taken off of the filestream
InputStr = BuffIn.GetStringMBS(0, AmtBytes) // InputStr should be byte-byte just like ThisStr, and encoding=Nil

// now I decompress this, it is designed to be decompressable
OutStr = DecompressZLibMBS(InputStr, AmtBytes * 60) // param 2 set very high to handle the decompression, assume this is enough
numBytes = Len(OutStr) // Len should work, since OutStr should be Nil
BuffOut = New MemoryBlock(numBytes)
BuffOut.SetStringMBS(OutStr, 0)

This always works, but I'm suspicious that in dealing with these strings, the encoding winds up somewhere in the process not Nil, because I want to deal with straight data and unfortuantely the functions you provide for unzipping deal with strings.

Please, also, I'm more focused on why this code may not work, more than re-coding to make it work, although eventually I'll do that. I'm interested in why this WOULDN'T work. I can't test on a Japanese Windows OS cause I don't have one, and I know it's a DBCS OS, and that could influence this. Or maybe not.

Garth Hjelte
Sampler User

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] MBS functions, encodings, and Japanese OS
Date: 02.04.13 12:10 (Tue, 2 Apr 2013 13:10:30 +0200)
From: Christian Schmitz

Am 02.04.2013 um 02:12 schrieb Garth Hjelte <<email address removed>>:

> Does running a Japanese version of Windows perhaps influence this type of code? (Please don't judge it on why it's written this way, I'm only concerned if it works.)
>
> ThisStr = FileStream.Read(AmtBytes) // I assume the encoding on ThisStr is Nil?

yes. As you pass no encoding to Read function.

> Buff = New MemoryBlock(Len(ThisStr)) // Len should work, since ThisStr should be Nil

For nil encoding strings, len and lenb are the same.

> Buff.SetStringMBS(XStr, 0) // the memoryblock should be byte-byte just like what was taken off of the file stream

Yes.
Why XStr and not ThisStr?

Buff = XStr
would do the same as those two lines above!

> InputStr = BuffIn.GetStringMBS(0, AmtBytes) // InputStr should be byte-byte just like ThisStr, and encoding=Nil

yes. Why buffIn here and not Buff like above?

InputStr = BuffIn would do the same.

> // now I decompress this, it is designed to be decompressable
> OutStr = DecompressZLibMBS(InputStr, AmtBytes * 60) // param 2 set very high to handle the decompression, assume this is enough

yes. Please check if OutStr.len = 0

> numBytes = Len(OutStr) // Len should work, since OutStr should be Nil

Should work.

> BuffOut = New MemoryBlock(numBytes)
> BuffOut.SetStringMBS(OutStr, 0)

Should also work.

> This always works, but I'm suspicious that in dealing with these strings, the encoding winds up somewhere in the process not Nil, because I want to deal with straight data and unfortuantely the functions you provide for unzipping deal with strings.

Well, you could compare memory blocks and see if something is not as expected.

Greetings
Christian