Skip to content

Instantly share code, notes, and snippets.

@mauricio
Created July 8, 2011 02:08
Show Gist options
  • Save mauricio/1070959 to your computer and use it in GitHub Desktop.
Save mauricio/1070959 to your computer and use it in GitHub Desktop.
Transliterate function for PT-BR
public class Utils {
public static String transliterate( String content ) {
return content.replaceAll( "(ã|á|â)" , "a")
.replaceAll( "(é|ê)", "e" )
.replaceAll( "(í)", "i" )
.replaceAll( "(ó|ô|õ)", "o" )
.replaceAll( "(ú)", "u" );
}
}
@rponte
Copy link

rponte commented Jul 20, 2011

I know it's too late but take a look at this,

https://gist.github.com/893494 (impl)
https://gist.github.com/893497 (test)

:-)

@mauricio
Copy link
Author

mauricio commented Jul 20, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment