Skip to content

allow unicode #111

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

Merged
merged 4 commits into from
Feb 22, 2022
Merged

allow unicode #111

merged 4 commits into from
Feb 22, 2022

Conversation

mrezzamoradi
Copy link
Collaborator

This non-intrusive change gives users the choice to allow Unicode characters in the final slug. I understand it might not be aligned with the initial goal of this project (URL path slugification), still I think it has valid use cases like when applications use slugified strings as filenames, e.g. exporting a google doc to PDF. The filename can contain Unicode. Some popular projects like Djange have this feature

Changes:

  • Added allow_unicode parameter with default to False.
  • Added DISALLOWED_UNICODE_CHARS_PATTERN regex pattern to filter out non-words.
  • Duplicated all previous tests and let them run with allow_unicode flag on to make sure the behaviour is unchanged.
  • Added/updated tests to test unicode strings.
  • Make sure emojis are not allowed

If you approve this proposal, then I or you can update the README file accordingly. We then need to modify the Wiki a bit as well.

solves #78
solves #24

@mrezzamoradi mrezzamoradi requested a review from un33k February 22, 2022 12:11
Copy link
Owner

@un33k un33k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrezzamoradi Everything looks great.

Could you also update the following files to reflect your changes since you have access to the main repo.

1 - Changelog
2 - Readme (add unicode usecase)
3 - version.py file (6.0.1 -> 6.1.0) [new feature, backward compatible]

It should be ready after the above.

I can also do the above, however, it would be best if it comes in as part of the original PR.

Thank you.

@mrezzamoradi mrezzamoradi changed the title initial commit to allow unicode allow unicode Feb 22, 2022
@un33k un33k merged commit d968ca7 into staging Feb 22, 2022
@un33k
Copy link
Owner

un33k commented Feb 22, 2022

Merged in, pushed to sandbox, ci and master. Official push to pypi. Thx

@mrezzamoradi mrezzamoradi deleted the feature/add-a-falg-to-support-unicode branch February 28, 2022 08:36
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

Successfully merging this pull request may close these issues.

2 participants