0

I'm building a Spanish dictionary. I get the definitions from www.rae.es . Problem:

the search engine doesn't work with acute accents ( á é í ó ú ). The output is an error message from rae.es stating that the word is not recognized. For example: for the word "baúl", this comes up (translated): "The word baúl isn't registered in the dictionary."

How can I use urlencode() or other function to solve this problem? Please check the code by right click and inspect element with Google Chrome, Safari or Firefox.

http://verbum.xtrweb.com/verbumpost.php?word=ba%C3%BAl&word0=

Thanks!

j1nma
  • 457
  • 3
  • 9
  • 24

2 Answers2

1

Try doing urlencode(utf8_encode($string)) instead of just urlencode($string).

Mikhail Vladimirov
  • 13,572
  • 1
  • 38
  • 40
0

Use htmlentities on your search term and try using post, not get: http://php.net/manual/en/function.htmlentities.php

Toon Casteele
  • 2,479
  • 15
  • 25