Re: Caracters in other languages

new topic     » goto parent     » topic index » view thread      » older message » newer message

If anyone wants a non-windows version of this, I have one.
Not sure if it will work 100% correctly considering that DOS and especially
the *nixes use different encodings and charsets than windows.

jbrown

On Tue, Jul 08, 2003 at 11:25:06AM +0100, Pete Lomax wrote:
> 
> 
> On Tue, 08 Jul 2003 10:12:02 +1000, Derek Parnell
> <ddparnell at bigpond.com> wrote:
> 
> >On Mon, 7 Jul 2003 18:06:38 -0500 (07/08/03 09:06:38)
> >, <gertie at visionsix.com> wrote:
> >> On 8 Jul 2003, at 8:53, Derek Parnell wrote:
> >>> From: <rml at rubis.trix.net>
> >>> Hi Euforians;
> >>>
> <many snips>
> >>> For example: =E9, =E7, =E3, =E1 and so on.
> >> Annoying, isn't it? Mirc does the same.
> >>> UC =3D repeat(1, 255)
> >>> for i =3D 1 to length(UC) do
> >>> UC[i] =3D i
> >>> LC =3D UC
> >>> UC['a'] =3D 'A'
> >>> UC['b'] =3D 'B'
> >>> UC['=E9'] =3D '=C9'
> >>> LC['A'] =3D 'a'
> >>> LC['B'] =3D 'b'
> >>> LC['=C9'] =3D '=E9'
> >>> for i =3D 1 to length(x) do
> >>> x[i] =3D Upper(x[i])
> >>> --=20
> >>
> >> What is "=3D" in all the above, and why the $^& is it there? If Topica 
> >> changed some Derek's code to "=3D", what other errors were introduced?
> >>
> >I don't know who or what is changing the characters but the '=c9' and '=e9' 
> >are uppercase E-Grave and lowercase E-Grave respectively.
> 
> I've finally snapped and wasted the morning writing a little utility
> so I can see what people are talking about (not specifically this
> post, I mean in general when this happens), try it on the above text:
> 
> I will certainly use it myself to filter all code I cut and paste from
> the mailing list (and the mailing list archive) in future.
> 
> Pete
> PS I just KNOW this post will get splatted with =3D's!!!

Not for me :D

> 
> clip.exw:
> --
> -- When you find an email is covered in =3D, =20 etc, copy the text
> -- to the windows clipboard and run this program.
> -- The encodings are stripped and the corrected text is both 
> -- displayed, and placed back on the clipboard. 
> -- Use Alt-F4 to close the window.
> -- You can also just leave it running in the background; alt-tab
> -- to it and the clipboard & display are automatically updated
> 
> include win32lib.ew
> constant 
> main=create(Window,"Quoted Printable Decode",0,0,0,800,600,0),
> mle=create(MleText,"",main,5,5,0.99,0.99,0)
> 
> sequence hout
> hout=repeat(-1,256)
> for i = 0 to 9 do
> 	hout[i+48]=i	-- '1'..'9' ['0' is already 0]
> end for
> for i = 10 to 15 do
> 	hout[i+55]=i	-- 'A'..'F'
> 	hout[i+87]=i	-- 'a'..'f'
> end for
> 
> global function qpd(sequence in) 
> 
> 	result={}
> 	k=1
> 	while k <= length(in) do
> 		if k<length(in)-1 
> 		and in[k]='=' 
> 		and hout[in[k+1]]!=-1 
> 		and hout[in[k+2]]!=-1 then
> 			result&=hout[in[k+1]]*16+hout[in[k+2]]
> 			k+=3
> 		else
> 			result&=in[k]
> 			k+=1
> 		end if
> 	end while
> 	return result
> end function
> 
> procedure onResizeMain(integer self, integer event, sequence params)
> sequence size
> 	if self or length(params) then end if	-- suppress warnings
> 	if event=w32HResize then
> 		size = getClientRect(main) -- returns {x1,y1,x2,y2}
> 		size[3]-=size[1]
> 		size[4]-=size[2]
> 		setCtlSize(mle,size[3]-10,size[4]-10)
> 	end if
> 	if event=w32HPaint then
> 		setIndex(mle,{1,0})
> 		paste(mle)
> 		setText(mle,qpd(getText(mle)))
> 		copy(mle)
> 	end if
> 	setFocus(mle)
> end procedure
>
> setHandler(main,{w32HResize,w32HActivate,w32HPaint},routine_id("onResizeMain"))
> 
> WinMain(main,Normal)
> 
> 
> 
> TOPICA - Start your own email discussion group. FREE!
> 
> 

-- 
 /"\  ASCII ribbon              | http://www.geocities.com/jbrown1050/
 \ /  campain against           | Linux User:190064
  X   HTML in e-mail and        | Linux Machine:84163
 /*\  news, and unneeded MIME   | http://verify.stanford.edu/evote.html

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu