From: Axel Etzold Date: 2008-08-19T07:22:23+09:00 Subject: Re: accented letters -------- Original-Nachricht -------- > Datum: Tue, 19 Aug 2008 06:58:30 +0900 > Von: angico > An: ruby-talk@ruby-lang.org > 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 > > > -- > angico > ------ > home page: www.angico.org > Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I > ------ > contatos: > email: angico@angico.org > skype: angico00 > ------ > -- GMX Kostenlose Spiele: Einfach online spielen und Spa� haben mit Pastry Passion! http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196