Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Letters with accent marks

Reply
Thread Tools

Letters with accent marks

 
 
Hickman Hickman
Guest
Posts: n/a
 
      11-17-2007
Any ideas?

I have a textBox that users will be entering data into and most likely
they will not bother to write the accent marks over the correct letters.
When performing the search I need a way to look at the words in the
database and say does it have a accent mark over it and if so ignore it
and render it as a, e, i, o, u. I tried to copy and paste these letters
with accent marks into the file but the program doesnt recognize them.

Any idea how to test for i with an accent mark, a with an accent mark,
etc...
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Jano Svitok
Guest
Posts: n/a
 
      11-17-2007
On Nov 17, 2007 1:58 AM, Hickman Hickman <(E-Mail Removed)> wrote:
> Any ideas?
>
> I have a textBox that users will be entering data into and most likely
> they will not bother to write the accent marks over the correct letters.
> When performing the search I need a way to look at the words in the
> database and say does it have a accent mark over it and if so ignore it
> and render it as a, e, i, o, u. I tried to copy and paste these letters
> with accent marks into the file but the program doesnt recognize them.
>
> Any idea how to test for i with an accent mark, a with an accent mark,
> etc...


I guess Iconv library is able to convert any encoding to plain ascii.

http://www.ruby-doc.org/stdlib/libdo...doc/index.html

you can try it online at http://www.iconv.com/iconv.htm

 
Reply With Quote
 
 
 
 
Devi Web Development
Guest
Posts: n/a
 
      11-18-2007
On Nov 16, 2007 6:58 PM, Hickman Hickman <(E-Mail Removed)> wrote:
> Any ideas?
>
> I have a textBox that users will be entering data into and most likely
> they will not bother to write the accent marks over the correct letters.
> When performing the search I need a way to look at the words in the
> database and say does it have a accent mark over it and if so ignore it
> and render it as a, e, i, o, u. I tried to copy and paste these letters
> with accent marks into the file but the program doesn't recognize them.
>
> Any idea how to test for i with an accent mark, a with an accent mark,
> etc...


If it's an issue with your text editor, you can put the escaped octal
version in.
For example, if you want to remove all acute accents, try this
str.gsub! "\303\241",'a'
str.gsub! "\303\251",'e'
str.gsub! "\303\255",'i'
str.gsub! "\303\263",'o'
str.gsub! "\303\272",'u'

-Daniel Brumbaugh Keeney

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
foreign language accent marks =?Utf-8?B?cm1zb21tZXI=?= Windows 64bit 20 09-15-2010 07:08 PM
Re: foreign language accent marks Jud Hendrix Windows 64bit 1 06-13-2010 02:11 PM
Regular Expression with accent letters aldobelli@gmail.com ASP General 5 03-05-2009 08:43 AM
making all letters Caps/Small Letters Merrigan Python 4 12-14-2007 10:10 AM
not dust marks - water marks! pshaw@emmet.com Digital Photography 0 04-14-2005 05:53 AM



Advertisments