Skip to content

Add type check to make sure unidecode is being passed a unicode string #8

Open

Description

@djds23

@iki I would be happy to work on this and submit a PR.

Activity

  1. iki commented on Jan 12, 2015

    @iki
    Owner

    @djds23 do you mean a shortcut that returns original string if it is not instance of unicode on python2, or str on python3?

  2. djds23 commented on Jan 12, 2015

    @djds23
    Author

    @iki thanks for asking, I was thinking unicode in python2

  3. iki commented on Jan 13, 2015

    @iki
    Owner

    @djds23 thanks for bringing this on, it's a good idea imo, please submit the PR if you want.

    btw, it has to be compatible with both python2/3, so you could probably set the unicode_type on the module level, and then in unidecode function just check if the passed value is instance of it:

    import sys
    unicode_type = unicode if sys.version_info.major < 3 else str
  4. self-assigned this
    on Oct 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions