Thread: PRS-500 RasterFarian 2.5 Beta
View Single Post
Old 06-25-2007, 02:05 AM   #63
alex_d
Addict
alex_d doesn't litteralex_d doesn't litter
 
Posts: 303
Karma: 187
Join Date: Dec 2006
Device: Sony Reader
doing utf-16...

I remember I had to insert the line:
cmd /A /C ECHO ^<?xml version=^"1.0^" encoding=^"UTF-16^"?^> > "%relpath%\temp\temp.lrs"
(instead of just ECHO ....) because of encoding problems. cmd /A is supposed to instruct echo to output in ansi. maybe you should try cmd /U? Also, I'm pretty sure that >> takes care to preserve encoding so if you start with a file that's in UTF-16, appending to it will also be UTF-16.


anyway, I've been meaning to rewrite all of this in c#
I've also been meaning to learn c#
The biggest problem right now is that CMD is a ridiculously, ridiculously bad language (ie, it's not even structured programming. you have to use fn gotos! and the gotos break the parts which Do try to be sort of structured! and types... wtf are types? you don't even have variables! every variable is like a "#define" and if it has certain characters, it'll break the code) and it's pretty frustrating to do anything sophisticated. I don't think microsoft ever even intended anyone to really use cmd scripts. you're supposed to use vbscript or jscript i guess. and back in dos days, BASIC.
alex_d is offline