Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Illegal Character
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
templest




PostPosted: Wed Aug 18, 2004 10:50 am   Post subject: Illegal Character

I'm writing an installer in turing, first step: extracting + inserting files into one big file to acompany the installer exe. I've got that down, but with files that use funy charcters (ie: ©, £, ñ, ₧, etc) I get an "Illegal Charcter" error. I'm loading these as strings, is there something I need to do?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Aug 18, 2004 12:12 pm   Post subject: (No subject)

well some ASCII values were not ment to be displayed Confused you're better off with binaries
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
templest




PostPosted: Wed Aug 18, 2004 4:01 pm   Post subject: (No subject)

I hate turing. I am disgusted
beard0




PostPosted: Tue Aug 31, 2004 8:35 pm   Post subject: (No subject)

another option is to use a char as opposed to a string variable. char allows chr(0) and chr(128), whereas strings don't.
beard0




PostPosted: Tue Aug 31, 2004 8:42 pm   Post subject: (No subject)

Just realised - this leads me into my own problem. I have been trying to write my own web server, and have been comming along quite well until I got to images. I can send them, but because they have a ton of chr(0) and chr(128) in them, I have to send them as individual characters, rather than as part of a longer string as I was able to do with html files:
code:
        loop
            sendString := ""
            for x : 1 .. 255
                exit when eof (chan)
                get : file, data
                sendString += data
            end for
            put : ns, sendString ..
            exit when eof (chan)
        end loop

(data was defined as a char)
The problem with this, is that this makes it hellishly slow. It took well over 30 seconds for it to send my browser a medium sized 16 color bmp, over localhost. Anybody have any ideas on how to clear this problem up?
beard0




PostPosted: Sat Sep 04, 2004 6:45 pm   Post subject: (No subject)

I found a solution: for anybody else who wants to do something similar, to send the image you have to read, rather than get from the image file, and then, although you read, dont write to send it, but put it to the netstream.
rizzix




PostPosted: Sun Sep 05, 2004 12:53 am   Post subject: (No subject)

may i also suggest u read it into a nat1 and then put that nat1 into ur netstream.. the keyword here is nat1 (which represents 1 unsigned byte).. u should do this for all *non ascii* data
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: