B
Billy Smith
I'm trying to write a little utility that will write some
binary data to a file via a javascript and Windows Script Host
under Windows XP. The only way to do this that I can find
is to convert the binary data to text via String.fromCharCode()
function and then write to the file with TextStream.Write().
But that function gives an "invalid parameter" error message
when I try to write some ASCII codes to the file. I could
understand if it refused to write any of the extended ASCII
characters but it accepts some and not others. For example
it will write characters with codes 157, 255, and 188 but
fails on 156 and 128, both of which are printable characters.
It works with ordinary characters (codes 0-127) just fine.
1) Why is it letting me write some extended ASCII characters and
not others?
2) It's beginning to look to me like javascript and WSH don't
provide a way to write binary data. Am I right or is there
a way to write binary data to a file using these tools?
Thanks,
Billy
binary data to a file via a javascript and Windows Script Host
under Windows XP. The only way to do this that I can find
is to convert the binary data to text via String.fromCharCode()
function and then write to the file with TextStream.Write().
But that function gives an "invalid parameter" error message
when I try to write some ASCII codes to the file. I could
understand if it refused to write any of the extended ASCII
characters but it accepts some and not others. For example
it will write characters with codes 157, 255, and 188 but
fails on 156 and 128, both of which are printable characters.
It works with ordinary characters (codes 0-127) just fine.
1) Why is it letting me write some extended ASCII characters and
not others?
2) It's beginning to look to me like javascript and WSH don't
provide a way to write binary data. Am I right or is there
a way to write binary data to a file using these tools?
Thanks,
Billy