I had an idea you could convert a string to a body8209 type with RecordSet
and
then write it to disk with the Stream object. but the closest I got on that
one was getting
stuck with some weird unicode/ascii mismatches adding a 0x00 char every
other byte on
the written file.
Does anyone have any info/example to achieve this in WSH/Jscript
environment,
especially involving the RecordSet object and how to use it for this special
case of "typecasting".
any help appreciated,
Thomas.
> I had an idea you could convert a string to a body8209 type with RecordSet
and then write it to disk with the Stream object. but the closest I got on
that one was getting stuck with some weird unicode/ascii mismatches adding a
0x00 char every other byte on the written file.
It sounds like it's still be handled as text. I don't know if this will help
but look around for functions that use Tristate parameters and maybe you can
handle the conversion better.
i.e. - Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Also, maybe this script utility package might help.
http://www.pstruh.cz/help/ScptUtl/library.htm
Regards,
Fred Chateau
you mean for ADODB.Stream ??
if you'r talking about FSO I already tried that. I can only get it to save
the chunk
at TristateTrue, in any other case will make FSO throw up an error.
in the resulting file some byte-ranges fails to go unicode ..
it's strange, i've seen examples in VBS using the FSO object to convert and
save
a stream as binary, but tryin the same in JScript wont do at all,
> Also, maybe this script utility package might help.
>
> http://www.pstruh.cz/help/ScptUtl/library.htm
yes, I've been peeking into that library.
infact, I'm am currenly using the VBS string to conversion methods/logic
from there.
the weird 0x00 result appears to be added at their RecordSet level.
I am pretty new to the ADODB api, is there a way to define encoding for
RecordSets ?
the reason I'd like to achieve this is because I'm in the works if
developing a Binary class supplying
methods to load and save binary code to disk in a WSH env. Currently I have
these going fine:
xmlHTTP -> binary file
binary file -> base64/bin.hex
but would also like :
base64/bin.hex/string -> binary file
Preferrably I would like to end up using no 3rd party software, using
Jscript, ADODB and the
XML objects alone
regards,
Thomas.
Q250344 - SAMPLE: ARRAYCONVERT.EXE Variant Conversion Functions
http://support.microsoft.com/support/kb/articles/Q250/3/44.ASP
which supports converting from a string to a byte array which is what an
binary type stream object expects...
--
Michael Harris
Microsoft.MVP.Scripting
--
"Thomas" <sp...@jet.st> wrote in message
news:a1cp4e$pt16o$1...@ID-12944.news.dfncis.de...