
-----------------------------------
templest
Wed Aug 18, 2004 10:50 am

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: Â©, Â£, Ã±, &#8359;, etc) I get an "Illegal Charcter" error. I'm loading these as strings, is there something I need to do?

-----------------------------------
Tony
Wed Aug 18, 2004 12:12 pm


-----------------------------------
well some ASCII values were not ment to be displayed :? you're better off with binaries

-----------------------------------
templest
Wed Aug 18, 2004 4:01 pm


-----------------------------------
I hate turing.  :disgusted:

-----------------------------------
beard0
Tue Aug 31, 2004 8:35 pm


-----------------------------------
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
Tue Aug 31, 2004 8:42 pm


-----------------------------------
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:
        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
Sat Sep 04, 2004 6:45 pm


-----------------------------------
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
Sun Sep 05, 2004 12:53 am


-----------------------------------
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
