Created
August 29, 2014 20:44
-
-
Save isouzasoares/82fdeb00db2d26142b30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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