Skip to content

Instantly share code, notes, and snippets.

@isouzasoares
Created August 29, 2014 20:44
Show Gist options
  • Save isouzasoares/82fdeb00db2d26142b30 to your computer and use it in GitHub Desktop.
Save isouzasoares/82fdeb00db2d26142b30 to your computer and use it in GitHub Desktop.
JAVASCRIPT
// unhappily had to do this, enconding error could not be resolve by now
// maybe sometime come back and resolve this, but anyway this works :)
function gamb(val){
return val.replace("í", "ii").replace("á", "aa").replace("é", "ee").replace("ó", "oo").replace("ú", "uu").replace("ã", "aaa").replace("ç", "ccc").replace("ô", "do");
}
PYTHON
def gamb(val):
"""
replace some chars unconverted(for unknown reason)
"""
# TODO: resolve encoding issues
if type(val) is str:
return val.replace("ii", "í")\
.replace("aaa", "ã")\
.replace("aa", "á")\
.replace("ee", "é")\
.replace("oo", "ó")\
.replace("uu", "ú")\
.replace("ccc", "ç")\
.replace("do", "ô")
return val
hauhauhuahfudhuhdufhduaf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment