1. Re: unicode and puts -- exwc

Something like that should work fine, problem is I develop with Apache2 on
Windows XP, then upload at intervals to my server which runs linux (I found the
trick of copying exu into a global path directory on windows and renaming it exu,
so all my scripts will run on windows with the shebang line #!./cgi-bin/exu)

I'm still waiting for the linux/BSD release of the new Euporia so I'm not
rushed...
Is there any quicker way to do it in linux also?

I'll have to experiment with that code in the morning as its 2am


Matt Lewis wrote:
> 
> FD(censored) wrote:
> > 
> > 
> > hrmm even exwc terminates so putting two bytes at a time will not work.
> > 
> > My $64,000 question then is, how do I put the byte "0" to the screen...
> > 
> > or it's back to UTF-8
> 
> How about this:
> }}}
<eucode>
> include dll.e
> 
> constant
> msvcrt = open_dll("msvcrt.dll"),
> putch_ = define_c_proc( msvcrt, "_putch", {C_INT} )
> 
> global procedure binputs( sequence data )
> 	for i = 1 to length(data) do
> 		c_proc( putch_, {data[i]})
> 	end for
> end procedure
> 
> binputs( "abc" & 0 & "def\n" )
> </eucode>
{{{

> 
> You could, of course, wrap binputs as a dll, if it's not fast enough for 
> you:
> // binio.c
> #include <conio.h>
> 
> 
> void __stdcall __export binputs( const char * s, int len ){
> 	while( len--)
> 		putch( *s++);
> }
> 
> int __stdcall LibMain(int hDLL, int Reason, void *Reserved)
> {
>     return 1;
> }
> 
> // end binio.c
> 
> To build with watcom:
> wcl386 binio.c -bd -ecd -zz -l=NT_DLL
> 
> Matt

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu