Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove accents/diacritics #3

Closed
nuno-carvalho opened this issue Dec 17, 2019 · 2 comments
Closed

Remove accents/diacritics #3

nuno-carvalho opened this issue Dec 17, 2019 · 2 comments

Comments

@nuno-carvalho
Copy link

Very nice app.... works like a charm.

For some languages (like Portuguese), it should remove accents/diacritics, cause it's not used in e-mail addresses.

I get it done with function...

def strip_accents(text):
    try:
        text = unicode(text, 'utf-8')
    except NameError: # unicode is a default on python 3 
        pass

    text = unicodedata.normalize('NFD', text)\
           .encode('ascii', 'ignore')\
           .decode("utf-8")

    return str(text)

....called before save to file!

@m8sec
Copy link
Owner

m8sec commented Dec 17, 2019

Hey @nuno-carvalho,

Thanks for the feedback :)

I have actually run into this issue recently myself too, this is great! Ill do some q/a on the code and hope to make a new commit soon! Will leave the issue open until then.

- m8r0wn

m8sec added a commit that referenced this issue Jan 14, 2020
@m8sec
Copy link
Owner

m8sec commented Jan 14, 2020

Just made a commit that should correct this issue with the unidecode library.

Thanks,
-m8r0wn

@m8sec m8sec closed this as completed Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants