Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

Fix lowercase issues with unicode characters #278

Merged
merged 4 commits into from
Oct 5, 2016

Conversation

javiereguiluz
Copy link
Member

@Pierstoval I tried your proposal in #197 but it didn't work for me. This new PR proposes to fix most of the errors for European languages. Sadly it won't work for Japanese, Chinese, Arabic, Hebrew, etc.

@stof
Copy link
Member

stof commented Sep 30, 2016

I would also remove any char not allowed in a composer package name (see the composer source code for their regex)

['çįßłŵž', 'cislwz'],
];
}
}
Copy link
Member

Choose a reason for hiding this comment

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

missing EOL

@Pierstoval
Copy link
Contributor

👍 for this 😄 Just need to make sure the box build works for php 5.4, or remove the travis build for this case

@javiereguiluz javiereguiluz merged commit 19b6799 into symfony:master Oct 5, 2016
javiereguiluz added a commit that referenced this pull request Oct 5, 2016
…viereguiluz)

This PR was merged into the 1.0-dev branch.

Discussion
----------

Fix lowercase issues with unicode characters

@Pierstoval I tried your proposal in #197 but it didn't work for me. This new PR proposes to fix most of the errors for European languages. Sadly it won't work for Japanese, Chinese, Arabic, Hebrew, etc.

Commits
-------

19b6799 Missing EOL
74d991b Clean the package names using the same regexp as Composer
4773869 Finished this feature
e1de703 Try to fix #190 by fixing lowercase package name
javiereguiluz added a commit to symfony/demo that referenced this pull request Oct 14, 2016
This PR was squashed before being merged into the master branch (closes #389).

Discussion
----------

Made the slugger compatible with every language

In the Symfony Installer we recently made a change to forbid any non-Latin character in the project names ([see details](symfony/symfony-installer#278)). This is needed because Composer itself requires that for package names.

In the Symfony Demo app we had a similar problem with the slugs of the blog posts. We removed any non-Latin character ... but that caused bugs like #136. I propose to change the slugger completely and accept any character.

For example, you can now create this blog post:

![backend_post](https://cloud.githubusercontent.com/assets/73419/19352609/b582a714-9160-11e6-81de-8e5130f1ec78.png)

And the blog listing no longer displays an error:

![blog_post](https://cloud.githubusercontent.com/assets/73419/19352619/bfbd87d0-9160-11e6-89fa-ca60aee1b5fe.png)

And the URL is perfectly fine although it contains non-Latin chars:

![url-post](https://cloud.githubusercontent.com/assets/73419/19352634/c9fc89c6-9160-11e6-999c-346b4da78653.png)

Commits
-------

161b508 Made the slugger compatible with every language
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants