Thread: PRS-500 RasterFarian 2.5 Beta
View Single Post
Old 06-25-2007, 02:12 AM   #64
athlonkmf
Guru
athlonkmf ought to be getting tired of karma fortunes by now.athlonkmf ought to be getting tired of karma fortunes by now.athlonkmf ought to be getting tired of karma fortunes by now.athlonkmf ought to be getting tired of karma fortunes by now.athlonkmf ought to be getting tired of karma fortunes by now.athlonkmf ought to be getting tired of karma fortunes by now.athlonkmf ought to be getting tired of karma fortunes by now.athlonkmf ought to be getting tired of karma fortunes by now.athlonkmf ought to be getting tired of karma fortunes by now.athlonkmf ought to be getting tired of karma fortunes by now.athlonkmf ought to be getting tired of karma fortunes by now.
 
Posts: 714
Karma: 1014039
Join Date: May 2007
Device: Sony PRS-500, Sony PRS-505, Kindle 3, Sony PRS350, iPad 64GB
Quote:
Originally Posted by alex_d View Post
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.
I made a litle beginning (or more like an ending) to do a rasterfarian in C#, and managed to do the netbpm, create lrs and output to lrf part (only missing the ghostview part), but then I stopped because... "why should I program it, if you were doing a good job already?" It's better to leave it up to you because I know for sure that I won't have time to update it.

And my other program wasn't really well accepted anyway.


ps. i had major trouble going through the CMD-code though.. with all the goto, lack of syntax highlighting and natural variablenames, it's kinda hard to read through it...
athlonkmf is offline