accented letters

A

angico

Hi, all.

I'm developing an application using FXRuby and need to enter text that
has accented letters in it (portuguese texts).

But the controls doesn't show the accented letters as I type them - just
the corresponding letter without the accent.

I've captured SEL_KEYPRESS for a FXText control and I can see that it
"sees" as I type in the key with the accent, and then the key for the
letter I want to have accented.

Here's an excerpt of the output of the captured event (the relevant
statement here is puts data.text << " (" << data.code.to_s << ")"):

(65505)
< (60)
p (112)
(65505)
(65505)
I (73)
s (115)
t (116)
o (111)
(32)
(65105)
e (101)
(32)
c (99)
e (101)
r (114)
t (116)
o (111)
(65505)
< (60)
/ (47)
p (112)
(65505)

-------------------

I know that (65105) is the code for the left shift. (65105) would be the
code for the acute accent, which followed by the letter e (101) should
give me an "e acute" (=C3=A9), but the control shows just the simple "e".

Does anybody have a hint on this?

TIA,

--=20
angico
 
A

Axel Etzold

-------- Original-Nachricht --------
Datum: Tue, 19 Aug 2008 00:21:51 +0900
Von: angico <[email protected]>
An: (e-mail address removed)
Betreff: accented letters
Hi, all.

I'm developing an application using FXRuby and need to enter text that
has accented letters in it (portuguese texts).

But the controls doesn't show the accented letters as I type them - just
the corresponding letter without the accent.

I've captured SEL_KEYPRESS for a FXText control and I can see that it
"sees" as I type in the key with the accent, and then the key for the
letter I want to have accented.

Here's an excerpt of the output of the captured event (the relevant
statement here is puts data.text << " (" << data.code.to_s << ")"):

(65505)
< (60)
p (112)
(65505)
(65505)
I (73)
s (115)
t (116)
o (111)
(32)
(65105)
e (101)
(32)
c (99)
e (101)
r (114)
t (116)
o (111)
(65505)
< (60)
/ (47)
p (112)
(65505)

-------------------

I know that (65105) is the code for the left shift. (65105) would be the
code for the acute accent, which followed by the letter e (101) should
give me an "e acute" (é), but the control shows just the simple "e".

Does anybody have a hint on this?

TIA,

Dear Angico,

you'll need to convert your text to utf-8 encoding using Iconv.
Have a look at this (somewhat randomly copied from a Wikipedia
article about the Brazilian sociologist Gilberto Freyre) and the FXRuby
tutorial:

require "rubygems"
require "iconv"
require 'fox16'

include Fox


theApp = FXApp.new
text = Iconv.iconv("utf-8","iso-8859-1","Interpretação do Brasil")
p text


theMainWindow = FXMainWindow.new(theApp, text[0])
text2="O Brasil do futuro não vai ser o que os velhos historiadores disserem e os de hoje repetem. Vai ser o que Gilberto Freyre disser. Freyre é um dos gênios de palheta mais rica e iluminante que estas terras antárticas ainda produziram."
message = Iconv.iconv("utf-8","iso-8859-1",text2)

theButton = FXButton.new(theMainWindow, message[0])
theButton.connect(SEL_COMMAND) do |sender, selector, data|
exit
end

theApp.create

theMainWindow.show
theApp.run

Best regards,

Axel
 
A

angico

Hi, Axel.

Thank you for the hints, but I think I didn't express myself clearly.

Actually, when the text is presented on the FXText control (coming from
a database), the control shows the accented letters pretty well.

The problem is when I try to insert new text. The application seems to
ignore the keystrokes relative to the accents, accepting just the
following keystroke, which is the actual letter.

I've already post this on the FXRuby users list, but they think it's a
Ruby matter.

I hope somebody could help me with this.

Cheers,


Em Ter, 2008-08-19 =C3=A0s 06:44 +0900, Axel Etzold escreveu:
Dear Angico,
=20
you'll need to convert your text to utf-8 encoding using Iconv.
Have a look at this (somewhat randomly copied from a Wikipedia
article about the Brazilian sociologist Gilberto Freyre) and the FXRuby
tutorial:
=20
require "rubygems"
require "iconv"
require 'fox16'
=20
include Fox
=20
=20
theApp =3D FXApp.new
text =3D Iconv.iconv("utf-8","iso-8859-1","Interpreta=C3=A7=C3=A3o do Bra= sil")
p text
=20
=20
theMainWindow =3D FXMainWindow.new(theApp, text[0])
text2=3D"O Brasil do futuro n=C3=A3o vai ser o que os velhos historiadore=
s disserem e os de hoje repetem. Vai ser o que Gilberto Freyre disser. Frey=
re =C3=A9 um dos g=C3=AAnios de palheta mais rica e iluminante que estas te=
rras ant=C3=A1rticas ainda produziram."
message =3D Iconv.iconv("utf-8","iso-8859-1",text2)
=20
theButton =3D FXButton.new(theMainWindow, message[0])
theButton.connect(SEL_COMMAND) do |sender, selector, data|
exit
end
=20
theApp.create
=20
theMainWindow.show
theApp.run
=20
Best regards,
=20
Axel=20
=20
--=20
angico
 
A

Axel Etzold

-------- Original-Nachricht --------
Datum: Tue, 19 Aug 2008 06:58:30 +0900
Von: angico <[email protected]>
An: (e-mail address removed)
Betreff: Re: accented letters
Hi, Axel.

Thank you for the hints, but I think I didn't express myself clearly.

Actually, when the text is presented on the FXText control (coming from
a database), the control shows the accented letters pretty well.

The problem is when I try to insert new text. The application seems to
ignore the keystrokes relative to the accents, accepting just the
following keystroke, which is the actual letter.

Dear Angico,

sorry, I misunderstood. You mean that you want to interact dynamically with
FXRuby in some way, like ask the user some question and have the user's
answer displayed ?
It seems that depending on what OS you use, you can define a connection key (on the system,
not in Ruby or FXRuby) so that accent+key are drawn together ... see here for Ubuntu:

http://ubuntuforums.org/archive/index.php/t-779463.html

To me ( I am not Brazilian or Portuguese) , the problem you are experiencing is somewhat surprising, as for instance in French or German, there are special keys that allow you to enter the whole letter in one go ... but the French don't have the tilde letters ~a and ~o ....
maybe general Portuguese language programming forums can help you if the connection-key hint doesn't work ...
I'd nevertheless like to know if it does.

Best regards,

Axel







I've already post this on the FXRuby users list, but they think it's a
Ruby matter.

I hope somebody could help me with this.

Cheers,


Em Ter, 2008-08-19 às 06:44 +0900, Axel Etzold escreveu:
Dear Angico,

you'll need to convert your text to utf-8 encoding using Iconv.
Have a look at this (somewhat randomly copied from a Wikipedia
article about the Brazilian sociologist Gilberto Freyre) and the FXRuby
tutorial:

require "rubygems"
require "iconv"
require 'fox16'

include Fox


theApp = FXApp.new
text = Iconv.iconv("utf-8","iso-8859-1","Interpretação do Brasil")
p text


theMainWindow = FXMainWindow.new(theApp, text[0])
text2="O Brasil do futuro não vai ser o que os velhos historiadores
disserem e os de hoje repetem. Vai ser o que Gilberto Freyre disser. Freyre é
um dos gênios de palheta mais rica e iluminante que estas terras
antárticas ainda produziram."
message = Iconv.iconv("utf-8","iso-8859-1",text2)

theButton = FXButton.new(theMainWindow, message[0])
theButton.connect(SEL_COMMAND) do |sender, selector, data|
exit
end

theApp.create

theMainWindow.show
theApp.run

Best regards,

Axel
 
A

angico

Em Ter, 2008-08-19 =C3=A0s 07:22 +0900, Axel Etzold escreveu:
Dear Angico,
=20
sorry, I misunderstood. You mean that you want to interact dynamically wi= th
FXRuby in some way, like ask the user some question and have the user's
answer displayed ?
It seems that depending on what OS you use, you can define a connection k= ey (on the system,
not in Ruby or FXRuby) so that accent+key are drawn together ... see here= for Ubuntu:
=20
http://ubuntuforums.org/archive/index.php/t-779463.html
=20
To me ( I am not Brazilian or Portuguese) , the problem you are experienc=
ing is somewhat surprising, as for instance in French or German, there are =
special keys that allow you to enter the whole letter in one go ... but the=
French don't have the tilde letters ~a and ~o ....
maybe general Portuguese language programming forums can help you if the =
connection-key hint doesn't work ...
I'd nevertheless like to know if it does.
=20
Best regards,
=20
Axel=20

Hi, Axel.

I use Ubuntu Linux 8.04. All the applications I have installed on my
system work fine (OpenOffice.org does, JEdit does, Eclipse does,
Evolution does, etc.)

The only one that refuses to "understand" the key combinations is
exactly this one I'm working on: An FXRuby application. Also, as I
already stated, the application can display the text correctly. It just
can't make the combination.

So, I guess the problem is with Ruby.

The brazilian ABNT2 keyboard has only one special key: =C3=A7. The remainin=
g
accented letters must be typed as a combination of a dead key (the
accent) followed by the actual letter key, as in ~a, which gives an =C3=A3.
But FXRuby's controls still don't accept or understand them.

Regards,

--=20
angico
 
A

Axel Etzold

-------- Original-Nachricht --------
Datum: Tue, 19 Aug 2008 08:42:55 +0900
Von: angico <[email protected]>
An: (e-mail address removed)
Betreff: Re: accented letters
Em Ter, 2008-08-19 às 07:22 +0900, Axel Etzold escreveu:

experiencing is somewhat surprising, as for instance in French or German, there are
special keys that allow you to enter the whole letter in one go ... but
the French don't have the tilde letters ~a and ~o ....
connection-key hint doesn't work ...

Hi, Axel.

I use Ubuntu Linux 8.04. All the applications I have installed on my
system work fine (OpenOffice.org does, JEdit does, Eclipse does,
Evolution does, etc.)

The only one that refuses to "understand" the key combinations is
exactly this one I'm working on: An FXRuby application. Also, as I
already stated, the application can display the text correctly. It just
can't make the combination.

So, I guess the problem is with Ruby.

The brazilian ABNT2 keyboard has only one special key: ç. The remaining
accented letters must be typed as a combination of a dead key (the
accent) followed by the actual letter key, as in ~a, which gives an ã.
But FXRuby's controls still don't accept or understand them.

Regards,

Dear Angico, dear all,

I have switched my keyboard layout to Brazilian and I can confirm your FXRuby accent entering troubles.
However, I am not sure whether the missing touch is in the Ruby camp rather than in FXRuby's.

When I tried some alternative GUI toolkit :
http://code.whytheluckystiff.net/shoes/wiki/DownloadShoes
(If you get an error missing -lruby, see here: http://code.whytheluckystiff.net/li...ake-returns-usr-bin-ld-cannot-find-lruby.html)

I could enter Brazilian accents in the reminder application in the sample directory of shoes.

This is due to the fact that shoes uses the pango library (http://www.pango.org/) for internationalization.
Now, on their page, they talk about integration with the GTK2 GUI toolkit, which, of course, isn't the
same as FOX, on which FXRuby builds.

As I am not an expert about the intricacies of using pango (or some equivalent) with Fox/FXRuby,
I am just CC'ing this message to the fxruby list.

Best regards,

Axel
 
A

angico

Em Ter, 2008-08-19 =C3=A0s 18:22 +0900, Axel Etzold escreveu:
-------- Original-Nachricht --------
Dear Angico, dear all,
=20
I have switched my keyboard layout to Brazilian and I can confirm your FX= Ruby accent entering troubles.
However, I am not sure whether the missing touch is in the Ruby camp rath= er than in FXRuby's.
=20
When I tried some alternative GUI toolkit : =20
http://code.whytheluckystiff.net/shoes/wiki/DownloadShoes
(If you get an error missing -lruby, see here: http://code.whytheluckysti= ff.net/list/shoes/2008/06/28/2998-re-error-make-returns-usr-bin-ld-cannot-f=
ind-lruby.html)
=20
I could enter Brazilian accents in the reminder application in the sample= directory of shoes.
=20
This is due to the fact that shoes uses the pango library (http://www.pan=
go.org/) for internationalization.
Now, on their page, they talk about integration with the GTK2 GUI toolkit= , which, of course, isn't the
same as FOX, on which FXRuby builds.
=20
As I am not an expert about the intricacies of using pango (or some equiv= alent) with Fox/FXRuby,=20
I am just CC'ing this message to the fxruby list.
=20
Best regards,
=20
Axel=20
=20
=20
=20

Thank you very much, Axel. It was very kind of you. I hope somebody at
FXRuby could help me with this.

Regards,

--=20
angico
 
L

Lyle Johnson

Actually, when the text is presented on the FXText control (coming from
a database), the control shows the accented letters pretty well.

The problem is when I try to insert new text. The application seems to
ignore the keystrokes relative to the accents, accepting just the
following keystroke, which is the actual letter.

I've already post this on the FXRuby users list, but they think it's a
Ruby matter.

I checked the FXRuby mailing list archives, and found where you posted
this question on the FXRuby list (around the beginning of last month).
I'm sorry you didn't get any helpful responses, but I don't see that
anyone suggested that it was "a Ruby matter".

It is most likely a FOX-related issue, and has something to do with
how FOX translates (or doesn't translate) those keypresses before
sending out the SEL_KEYPRESS and SEL_KEYRELEASE messages. FXRuby
doesn't do any manipulation of those results; it just passes through
whatever the FOX library generates. You might have better luck asking
on the FOX mailing list.
 
A

angico

Em Qua, 2008-08-20 =C3=A0s 00:50 +0900, Lyle Johnson escreveu:
I checked the FXRuby mailing list archives, and found where you posted
this question on the FXRuby list (around the beginning of last month).
I'm sorry you didn't get any helpful responses, but I don't see that
anyone suggested that it was "a Ruby matter".
=20
It is most likely a FOX-related issue, and has something to do with
how FOX translates (or doesn't translate) those keypresses before
sending out the SEL_KEYPRESS and SEL_KEYRELEASE messages. FXRuby
doesn't do any manipulation of those results; it just passes through
whatever the FOX library generates. You might have better luck asking
on the FOX mailing list.
=20

Hi, Lyle.

Well, it was actually myself, who thought it was a Ruby matter.

So, where can I find that FOX mailing list?

Thank you,

--=20
angico
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,125
Latest member
VinayKumar Nevatia_
Top