Letters with accent marks

H

Hickman Hickman

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

Jano Svitok

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/libdoc/iconv/rdoc/index.html

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

Devi Web Development

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
 

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,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top