1. Caracters in other languages

Hi Euforians;

         I'm having problems with caracters with an accent in portuguese=20
and euphoria. If I use uppercase, they are not changed to uppercase, they=20
changed into spaces (or no asc caracters.)
For example: =E9, =E7, =E3, =E1 and so on.
The same happens when I use getc to read a txt file that cotains these=20
caracters.
         My computer is running win2000 in english, with locale in=20
brazilian portuguese.

         Any suggestion ?

         Thanks

Rubens
Campinas - SP - Brazil

P.S. Derek and Pete: I'm trying the instructions from Derek for the rezize=
=20
of listview. thanks.



At 22:47 5/7/2003, you wrote:
>
>
>----- Original Message -----
>From: <rml at rubis.trix.net>
>To: "EUforum" <EUforum at topica.com>
>Sent: Sunday, July 06, 2003 4:45 AM
>Subject: Resize a Listview
>
>
> > Hi people;
> >
> >          Anyone could show to me (or indicated where I can found) how a
> > Listview can be automatic resized when I resize a window ?
> >
>
>Assuming you are using win32lib.
>
>The outside edge size of the listview is just a simple to resize as any
>other control.
>
>a) Create a handler for the w32HResize event for the containing Window.
>b) In the handler code, get the new size of the window using
>getClientSize(win).
>c) Calculate the new size of the listview edges, based on whatever basis=
 you
>like.
>d) call setRect(listview, ...) using the new calculated sizes and position
>data.
>
>The hard bit is working out how to change the width of the columns=
 (assuming
>a Report View listview). In one of my apps, I try to keep the relative
>proportions the same, down to a minimum column size.
>  a) When you create the listview for the first time, record the size of=
 it.
>Then in the resize event handler...
>  b) Get the current widths of each column.
>      sequence colwid colwid =3D {}
>      for ColNum =3D 1 to ColumnCount do
>          colwid &=3D sendMessage(lv, LVM_GETCOLUMNWIDTH, ColNum-1, 0)
>      end for
>  c) Get the old size of the listview before the resize
>  d) Calc new listview size as in above method.
>  e) For each column, calc the new width as ( (NewSize/OldSize) * oldWidth)
>     colwid *=3D (NewSize/OldSize)
>  f) set The new column widths
>      for ColNum =3D 1 to ColumnCount do
>          VOID =3D sendMessage(lv, LVM_SETCOLUMNWIDTH, ColNum-1,=
 colwid[ColNum]
>* #FFFF)
>      end for
>  g) Save the listview size (OldSize) for the next resize event.
>
>By the way, you can use these special values to set the widths...
>     LVSCW_AUTOSIZE -- Auto size to the column's current contents
>     LVSCW_AUTOSIZE_USEHEADER -- Auto size to the current heading text.
>
>--
>Derek
>
>
>
>TOPICA - Start your own email discussion group. FREE!
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

new topic     » topic index » view message » categorize

2. Re: Caracters in other languages

----- Original Message -----=20
From: <rml at rubis.trix.net>
To: "EUforum" <EUforum at topica.com>
Subject: Caracters in other languages




Hi Euforians;

         I'm having problems with caracters with an accent in portuguese
and euphoria. If I use uppercase, they are not changed to uppercase, they
changed into spaces (or no asc caracters.)
For example: =E9, =E7, =E3, =E1 and so on.
The same happens when I use getc to read a txt file that cotains these
caracters.
         My computer is running win2000 in english, with locale in
brazilian portuguese.

         Any suggestion ?

---------
Derek replies...

The Euphoria upper() and lower() functions only work for the English
alphabet and only for ASCII character sets.


sequence UC,LC

UC =3D repeat(1, 255)
for i =3D 1 to length(UC) do
   UC[i] =3D i
end for
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'
. . .

function Upper(object x)
   if integer(x) and x > 0 and x < 256 then
       return UC[x]
   elsif sequence(x) then
       for i =3D 1 to length(x) do
           x[i] =3D Upper(x[i])
       end for
   end if
end function

and similar for your Lower function.

These are slower than the Euphoria ones, but a lot more accurate.
--=20
Derek

new topic     » goto parent     » topic index » view message » categorize

3. Re: Caracters in other languages

On 8 Jul 2003, at 8:53, Derek Parnell wrote:

> 
> 
> ----- Original Message -----=20
> From: <rml at rubis.trix.net>
> To: "EUforum" <EUforum at topica.com>
> Subject: Caracters in other languages
> 
> 
> Hi Euforians;
> 
>          I'm having problems with caracters with an accent in portuguese
> and euphoria. If I use uppercase, they are not changed to uppercase, they
> changed into spaces (or no asc caracters.)
> For example: =E9, =E7, =E3, =E1 and so on.
> The same happens when I use getc to read a txt file that cotains these
> caracters.
>          My computer is running win2000 in english, with locale in
> brazilian portuguese.
> 
>          Any suggestion ?
> 
> ---------
> Derek replies...
> 
> The Euphoria upper() and lower() functions only work for the English
> alphabet and only for ASCII character sets.

Annoying, isn't it? Mirc does the same.
 
> sequence UC,LC
> 
> UC =3D repeat(1, 255)
> for i =3D 1 to length(UC) do
>    UC[i] =3D i
> end for
> 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'
> . . .
> 
> function Upper(object x)
>    if integer(x) and x > 0 and x < 256 then
>        return UC[x]
>    elsif sequence(x) then
>        for i =3D 1 to length(x) do
>            x[i] =3D Upper(x[i])
>        end for
>    end if
> end function
> 
> and similar for your Lower function.
> 
> These are slower than the Euphoria ones, but a lot more accurate.
> --=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?

Kat

new topic     » goto parent     » topic index » view message » categorize

4. Re: Caracters in other languages

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:
>
>>
>> ----- Original Message -----=20
>> From: <rml at rubis.trix.net>
>> To: "EUforum" <EUforum at topica.com>
>> Sent: Tuesday, July 08, 2003 8:19 AM
>> Subject: Caracters in other languages
>>
>>
>> Hi Euforians;
>>
>> I'm having problems with caracters with an accent in portuguese
>> and euphoria. If I use uppercase, they are not changed to uppercase, 
>> they
>> changed into spaces (or no asc caracters.)
>> For example: =E9, =E7, =E3, =E1 and so on.
>> The same happens when I use getc to read a txt file that cotains these
>> caracters.
>> My computer is running win2000 in english, with locale in
>> brazilian portuguese.
>>
>> Any suggestion ?
>>
>> ---------
>> Derek replies...
>>
>> The Euphoria upper() and lower() functions only work for the English
>> alphabet and only for ASCII character sets.
>
> Annoying, isn't it? Mirc does the same.
>
>> sequence UC,LC
>>
>> UC =3D repeat(1, 255)
>> for i =3D 1 to length(UC) do
>> UC[i] =3D i
>> end for
>> 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'
>> . . .
>>
>> function Upper(object x)
>> if integer(x) and x > 0 and x < 256 then
>> return UC[x]
>> elsif sequence(x) then
>> for i =3D 1 to length(x) do
>> x[i] =3D Upper(x[i])
>> end for
>> end if
>> end function
>>
>> and similar for your Lower function.
>>
>> These are slower than the Euphoria ones, but a lot more accurate.
>> --=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.


-- 

cheers,
Derek Parnell

new topic     » goto parent     » topic index » view message » categorize

5. Re: Caracters in other languages

by holmes.peterlink.ru (8.12.6/8.12.6) with ESMTP id h684chfE051927
	for <EUforum at topica.com>; Tue, 8 Jul 2003 08:38:44 +0400 (MSD)
	by stapleton.peterlink.ru (8.12.3/8.12.3) with ESMTP id h684c5ZU036453
	for <EUforum at topica.com>; Tue, 8 Jul 2003 08:38:06 +0400 (MSD)

Hi Rubens,

----------
> from: rml at rubis.trix.net
>=20
> Hi Euforians;
>=20
>          I'm having problems with caracters with an accent in portuguese=
=20
> and euphoria. If I use uppercase, they are not changed to uppercase, they=


> changed into spaces (or no asc caracters.)
> For example: =E9, =E7, =E3, =E1 and so on.
> The same happens when I use getc to read a txt file that cotains these=
=20
> caracters.
>          My computer is running win2000 in english, with locale in=20
> brazilian portuguese.
>=20
>          Any suggestion ?
>=20
>          Thanks
>=20
> Rubens


You have to write your own function to change=20
the case of the letters with codes above 128.

RDS standard function works on pure latin alphabet only.
As an example you can see my function case_ru()
from the=20
http://www.RapidEuphoria.com/ru_eu.zip=20
package,  lib file  wildcarr.e.

Regards,
Igor Kachan
kinz at peterlink.ru

new topic     » goto parent     » topic index » view message » categorize

6. Re: Caracters in other languages

On 8 Jul 2003, at 8:35, Igor Kachan wrote:

<snip>

> As an example you can see my function case_ru()
> from the=20
> http://www.RapidEuphoria.com/ru_eu.zip=20

from: http://www.rapideuphoria.com/ru_eu.zip=20 
Not Found
The requested URL /ru_eu.zip=20 was not found on this server.


Kat

new topic     » goto parent     » topic index » view message » categorize

7. Re: Caracters in other languages

Hello Kat,

----------
> 
> On 8 Jul 2003, at 8:35, Igor Kachan wrote:
> 
> <snip>
> 
> > As an example you can see my function case_ru()
> > from the=20
> > http://www.RapidEuphoria.com/ru_eu.zip=20
> 
> from: http://www.rapideuphoria.com/ru_eu.zip=20 
> Not Found
> The requested URL /ru_eu.zip=20 was not found on this server.
> 
> Kat

Topica added =20 to good URL.

Try to search Russian Toolkit on The Archive page.
Both URL and search work OK for me.

Good Luck Kat  smile

Regards,
Igor Kachan
kinz at peterlink.ru

new topic     » goto parent     » topic index » view message » categorize

8. Re: Caracters in other languages

On 8 Jul 2003, at 9:02, Igor Kachan wrote:

> 
> 
> Hello Kat,
> 
> ----------
> > 
> > On 8 Jul 2003, at 8:35, Igor Kachan wrote:
> > 
> > <snip>
> > 
> > > As an example you can see my function case_ru()
> > > from the=20
> > > http://www.RapidEuphoria.com/ru_eu.zip=20
> > 
> > from: http://www.rapideuphoria.com/ru_eu.zip=20 
> > Not Found
> > The requested URL /ru_eu.zip=20 was not found on this server.
> > 
> > Kat
> 
> Topica added =20 to good URL.

<snip>

I know, that was my sole point.

Kat

new topic     » goto parent     » topic index » view message » categorize

9. Re: Caracters in other languages

----- Original Message ----- 
From: <gertie at visionsix.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Caracters in other languages


>
>
> On 8 Jul 2003, at 9:02, Igor Kachan wrote:
>
> >
> > Hello Kat,
> >
> > ----------
> > >
> > > On 8 Jul 2003, at 8:35, Igor Kachan wrote:
> > >
> > > <snip>
> > >
> > > > As an example you can see my function case_ru()
> > > > from the=20
> > > > http://www.RapidEuphoria.com/ru_eu.zip=20
> > >
> > > from: http://www.rapideuphoria.com/ru_eu.zip=20
> > > Not Found
> > > The requested URL /ru_eu.zip=20 was not found on this server.
> > >
> > > Kat
> >
> > Topica added =20 to good URL.
>
> <snip>
>
> I know, that was my sole point.

I don't think is is Topica, because the original email that started this
came through to me perfectly. All accented characters were represented by
their correct glyph.
-- 
Derek

new topic     » goto parent     » topic index » view message » categorize

10. Re: Caracters in other languages

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: =3DE9, =3DE7, =3DE3, =3DE1 and so on.
>> Annoying, isn't it? Mirc does the same.
>>> UC =3D3D repeat(1, 255)
>>> for i =3D3D 1 to length(UC) do
>>> UC[i] =3D3D i
>>> LC =3D3D UC
>>> UC['a'] =3D3D 'A'
>>> UC['b'] =3D3D 'B'
>>> UC['=3DE9'] =3D3D '=3DC9'
>>> LC['A'] =3D3D 'a'
>>> LC['B'] =3D3D 'b'
>>> LC['=3DC9'] =3D3D '=3DE9'
>>> for i =3D3D 1 to length(x) do
>>> x[i] =3D3D Upper(x[i])
>>> --=3D20
>>
>> What is "=3D3D" in all the above, and why the $^& is it there? If =
Topica=20
>> changed some Derek's code to "=3D3D", what other errors were =
introduced?
>>
>I don't know who or what is changing the characters but the '=3Dc9' and =
'=3De9'=20
>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 =3D3D's!!!

clip.exw:
--
-- When you find an email is covered in =3D3D, =3D20 etc, copy the text
-- to the windows clipboard and run this program.
-- The encodings are stripped and the corrected text is both=20
-- displayed, and placed back on the clipboard.=20
-- 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=20
main=3Dcreate(Window,"Quoted Printable Decode",0,0,0,800,600,0),
mle=3Dcreate(MleText,"",main,5,5,0.99,0.99,0)

sequence hout
hout=3Drepeat(-1,256)
for i =3D 0 to 9 do
	hout[i+48]=3Di	-- '1'..'9' ['0' is already 0]
end for
for i =3D 10 to 15 do
	hout[i+55]=3Di	-- 'A'..'F'
	hout[i+87]=3Di	-- 'a'..'f'
end for

global function qpd(sequence in)=20
-------------------------------------
sequence result
integer k

	result=3D{}
	k=3D1
	while k <=3D length(in) do
		if k<length(in)-1=20
		and in[k]=3D'=3D'=20
		and hout[in[k+1]]!=3D-1=20
		and hout[in[k+2]]!=3D-1 then
			result&=3Dhout[in[k+1]]*16+hout[in[k+2]]
			k+=3D3
		else
			result&=3Din[k]
			k+=3D1
		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=3Dw32HResize then
		size =3D getClientRect(main) -- returns {x1,y1,x2,y2}
		size[3]-=3Dsize[1]
		size[4]-=3Dsize[2]
		setCtlSize(mle,size[3]-10,size[4]-10)
	end if
	if event=3Dw32HPaint 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("onResizeM=
ain"))

WinMain(main,Normal)

new topic     » goto parent     » topic index » view message » categorize

11. Re: Caracters in other languages

Hello Derek,

> 
> >
> > On 8 Jul 2003, at 9:02, Igor Kachan wrote:
> > >
> > > Hello Kat,
> > > ----------
> > > >
> > > > On 8 Jul 2003, at 8:35, Igor Kachan wrote:
> > > >
> > > > <snip>
> > > >
> > > > > As an example you can see my function case_ru()
> > > > > from the=20
> > > > > http://www.RapidEuphoria.com/ru_eu.zip=20
> > > >
> > > > from: http://www.rapideuphoria.com/ru_eu.zip=20
> > > > Not Found
> > > > The requested URL /ru_eu.zip=20 was not found on this server.
> > > >
> > > > Kat
> > >
> > > Topica added =20 to good URL.
> >
> > <snip>
> > I know, that was my sole point.
> 
> I don't think is is Topica, because the original 
> email that started this came through to me 
> perfectly. All accented characters were 
> represented by their correct glyph.
> -- 
> Derek

Do you know foreign glyphs, which you see, 
are perfectly correct?

I got the original email, which started this 
thread, without well visible damages too. 
It seems Topica changes the messages if these 
>128 characters get into the service part of 
the message - From, To, etc.

Regards,
Igor Kachan
kinz at peterlink.ru

new topic     » goto parent     » topic index » view message » categorize

12. Re: Caracters in other languages

Thanks Igor !

At 01:35 8/7/2003, you wrote:
>
>         by holmes.peterlink.ru (8.12.6/8.12.6) with ESMTP id h684chfE051927
>         for <EUforum at topica.com>; Tue, 8 Jul 2003 08:38:44 +0400 (MSD)
>         by stapleton.peterlink.ru (8.12.3/8.12.3) with ESMTP id 
> h684c5ZU036453
>         for <EUforum at topica.com>; Tue, 8 Jul 2003 08:38:06 +0400 (MSD)
>
>Hi Rubens,
>
>----------
> > from: rml at rubis.trix.net
> > to: EUforum <EUforum at topica.com>
> >sent: 8 july 2003 y. 2:19
> >=20
> > Hi Euforians;
> >=20
> >          I'm having problems with caracters with an accent in portuguese=
>=20
> > and euphoria. If I use uppercase, they are not changed to uppercase, they=
>
>
> > changed into spaces (or no asc caracters.)
> > For example: =E9, =E7, =E3, =E1 and so on.
> > The same happens when I use getc to read a txt file that cotains these=
>=20
> > caracters.
> >          My computer is running win2000 in english, with locale in=20
> > brazilian portuguese.
> >=20
> >          Any suggestion ?
> >=20
> >          Thanks
> >=20
> > Rubens
>
>
>You have to write your own function to change=20
>the case of the letters with codes above 128.
>
>RDS standard function works on pure latin alphabet only.
>As an example you can see my function case_ru()
>from the=20
>http://www.RapidEuphoria.com/ru_eu.zip=20
>package,  lib file  wildcarr.e.
>
>Regards,
>Igor Kachan
>kinz at peterlink.ru
>
>
>
>TOPICA - Start your own email discussion group. FREE!

new topic     » goto parent     » topic index » view message » categorize

13. Re: Caracters in other languages

----- Original Message -----=20
From: "Igor Kachan" <kinz at peterlink.ru>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Caracters in other languages


>=20
>=20
> Hello Derek,
>=20
[snip]
> >=20
> > I don't think is is Topica, because the original=20
> > email that started this came through to me=20
> > perfectly. All accented characters were=20
> > represented by their correct glyph.
> > --=20
> > Derek
>=20
> Do you know foreign glyphs, which you see,=20
> are perfectly correct?

Yes. Why do you doubt my word on that?

My proof is that when the message 'source' is viewed the '=3DE9' =
character is drawn on my screen (using Outlook Express) as a lower-case =
e-grave (=C3=A9) which corresponds to character glyph# 233 in the =
Courier New font I'm using. Even though I'm not absolutely positive that =
the author intended to write this character, it seems a good guess given =
the context of the message.

I'm writing this note using the UTF-8 encoding. Hope you get to see it =
correctly.
=20
> I got the original email, which started this=20
> thread, without well visible damages too.=20
> It seems Topica changes the messages if these=20
> >128 characters get into the service part of=20
> the message - From, To, etc.
>=20
> Regards,
> Igor Kachan
> kinz at peterlink.ru
>=20
> =
>=20
>=20
> TOPICA - Start your own email discussion group. FREE!
> =
>=20
>=20
>

new topic     » goto parent     » topic index » view message » categorize

14. Re: Caracters in other languages

Hello Derek again,

> 
> > 
> > Hello Derek,
> > 
> [snip]
> > > 
> > > I don't think is is Topica, because the original 
> > > email that started this came through to me 
> > > perfectly. All accented characters were 
> > > represented by their correct glyph.
> > > -- 
> > > Derek
> > 
> > Do you know foreign glyphs, which you see, 
> > are perfectly correct?
> 
> Yes. Why do you doubt my word on that?

Very good, sorry, just myself I'm not sure if I do see
the proper foreign glyph after these e-mail things, or not.

> My proof is that when the message 'source' is viewed 
> the '=E9' character is drawn on my screen (using Outlook Express)
> as a lower-case e-grave  NNNN  which corresponds to character 
> glyph# 233 in the Courier New font I'm using. 
> Even though I'm not absolutely positive that the author 
> intended to write this character, it seems a good guess 
> given the context of the message.
> 
> I'm writing this note using the UTF-8 encoding. 
> Hope you get to see it correctly.

Yes, I got your message in UTF-8 encoding.
But I see not "a lower-case e-grave" in
the brackets I deleted to avoid the damages, but 
"the upper-case latin letter A with two dots 
above plus copyright sign"

Good, no?

But these things may be my provider's blame too.
I just do not know exactly. 
My provider says he does these things properly.
I think he is right, just I know these Russian mumbos/jumbos
with 5 different old good encodings plus with new UTFs.

> > I got the original email, which started this 
> > thread, without well visible damages too. 
> > It seems Topica changes the messages if these 
> > >128 characters get into the service part of 
> > the message - From, To, etc.
> > 
> > Regards,
> > Igor Kachan
> > kinz at peterlink.ru

Regards again,
Igor Kachan
kinz at peterlink.ru

new topic     » goto parent     » topic index » view message » categorize

15. Re: Caracters in other languages

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 message » categorize

16. Re: Caracters in other languages

Hi Rubens,
if you want to do the conversion under Windows (running exw), you may use
Windows API to this for you. The functions are CharLowerA and CharUpperA.
Jiri Nemec has done a wrapper for these functions and it is in the archive
"nlsEu.ew -- National Language Support from Windows for Euphoria". It is al=
so
used in Judith's IDE. I think his routines could be speeded up by letting
Char{Lower,Upper}A convert allocated_string(), rather than converting byte-=
by-byte.

    Martin

----- Original Message -----
From: <rml at rubis.trix.net>
To: "EUforum" <EUforum at topica.com>
Sent: Tuesday, July 08, 2003 12:19 AM
Subject: Caracters in other languages


Hi Euforians;

         I'm having problems with caracters with an accent in portuguese
and euphoria. If I use uppercase, they are not changed to uppercase, they
changed into spaces (or no asc caracters.)
For example: =E9, =E7, =E3, =E1 and so on.
The same happens when I use getc to read a txt file that cotains these
caracters.
         My computer is running win2000 in english, with locale in
brazilian portuguese.

         Any suggestion ?

         Thanks

Rubens
Campinas - SP - Brazil

new topic     » goto parent     » topic index » view message » categorize

17. Re: Caracters in other languages

Nice solution Martin !
I will look for the archive nlsEu.ew right now.
Thanks

Rubens


At 09:03 9/7/2003, you wrote:
>
>
>Hi Rubens,
>if you want to do the conversion under Windows (running exw), you may use
>Windows API to this for you. The functions are CharLowerA and CharUpperA.
>Jiri Nemec has done a wrapper for these functions and it is in the archive
>"nlsEu.ew -- National Language Support from Windows for Euphoria". It is al=
>so
>used in Judith's IDE. I think his routines could be speeded up by letting
>Char{Lower,Upper}A convert allocated_string(), rather than converting byte-=
>by-byte.
>
>     Martin
>
>----- Original Message -----
>From: <rml at rubis.trix.net>
>To: "EUforum" <EUforum at topica.com>
>Sent: Tuesday, July 08, 2003 12:19 AM
>Subject: Caracters in other languages
>
>
>Hi Euforians;
>
>          I'm having problems with caracters with an accent in portuguese
>and euphoria. If I use uppercase, they are not changed to uppercase, they
>changed into spaces (or no asc caracters.)
>For example: =E9, =E7, =E3, =E1 and so on.
>The same happens when I use getc to read a txt file that cotains these
>caracters.
>          My computer is running win2000 in english, with locale in
>brazilian portuguese.
>
>          Any suggestion ?
>
>          Thanks
>
>Rubens
>Campinas - SP - Brazil
>
>
>
>TOPICA - Start your own email discussion group. FREE!

new topic     » goto parent     » topic index » view message » categorize

18. Re: Caracters in other languages

Hi Pete, you wrote:

<snip>

> 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!!!

Cool, thank you!
This utility also is useful for me with Gravity, which is my favourite
newsreader, but has some problems with displaying certain characters
correctly, too.

Also, for people like me, who have very little Win32Lib experience, your
utility is a very nice template for doing clipboard manipulation.
The function qpd() of course can be replaced by almost any other string
processing function (math calculations, word counting, encryption,
German/English translation [1] ...)

> 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.

On my system (Win 98/1st edition), I had to add at least one line, in
order to place the corrected text back on the clipboard (see --** below).

> -- 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

For leaving it running in the background, I would like it very much, if
the icon of the program would appear in the system area of the taskbar,
rather than in the "main" area. Can this easily be achieved?

> 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)
> -------------------------------------
> sequence result
> integer k
>
> 	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)))

                if autoSelect(mle,True) then end if    --** by JuLu
> 		copy(mle)
                if autoSelect(mle,False) then end if   --** looks better


> 	end if
> 	setFocus(mle)
> end procedure
>
> setHandler(main,{w32HResize,w32HActivate,w32HPaint},routine_id("onResizeMain"))
>
> WinMain(main,Normal)

Best regards,
   Juergen

-----------
[1] This is actually a kind of encryption. >:-> SCNR

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu