8000 Allow use of UTF-8 catalogues in non-UTF-8 applications by Seldaek · Pull Request #2339 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Allow use of UTF-8 catalogues in non-UTF-8 applications #2339

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 2 commits into from
Oct 7, 2011

Conversation

Seldaek
Copy link
Member
@Seldaek Seldaek commented Oct 7, 2011

This is #2313 but targetting the master branch.

Bug fix: yes
Feature addition: ?:)
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -

The problem I'm having is that, while porting an existing app, we are using UTF-8 everywhere to have a migration path ready, but the current application and DB is still in ISO-8859-1, which means translations containing accented chars are broken.

Also, we didn't hit the issue yet since we don't use forms much, but I imagine we would have similar issues with core translations for the validator which are all UTF-8 encoded.

Note that I explicitly suppressed this conversion in case your application is setup as UTF-8, to make sure most people are not affected by any slow down this introduces.

fabpot added a commit that referenced this pull request Oct 7, 2011
Commits
-------

5473d3b [Translation] Allow use of UTF-8 encoded catalogues into non-UTF-8 applications
deb6dea [Translation] Add failing tests to verify that UTF-8 lang files can't be used with another charset

Discussion
----------

Allow use of UTF-8 catalogues in non-UTF-8 applications

This is #2313 but targetting the master branch.

Bug fix: yes
Feature addition: ?:)
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -

The problem I'm having is that, while porting an existing app, we are using UTF-8 everywhere to have a migration path ready, but the current application and DB is still in ISO-8859-1, which means translations containing accented chars are broken.

Also, we didn't hit the issue yet since we don't use forms much, but I imagine we would have similar issues with core translations for the validator which are all UTF-8 encoded.

Note that I explicitly suppressed this conversion in case your application is setup as UTF-8, to make sure most people are not affected by any slow down this introduces.
@fabpot fabpot merged commit 5473d3b into symfony:master Oct 7, 2011
@Seldaek
Copy link
Member Author
Seldaek commented Oct 17, 2011

I do wonder if this should be reverted or not. I had to abandon it for another more customized solution here. The reason is that some strings aren't different enough to trigger UTF-8 or ISO-8559-15, take "ü" for example, depending on the mb_detect_encoding encoding order you pass, it will always detect the first encoding of the two, because there's not enough info in "ü" to distinguish. Then it force-decoded stuff that was already in ISO-8859-1, or failed to decode stuff that was in UTF-8 depending on the order I set.

Now this might still come in handy for eastern european, arabic, russian, asian languages and the others I forget which are all way beyond the ISO-8559-1/UTF-8 compatibility range. So maybe it's ok to leave it in.

fabpot added a commit that referenced this pull request Oct 23, 2011
< 5D1E input type="hidden" data-csrf="true" name="authenticity_token" value="+M5dlXviNx6RdZqboWhkjZJq+XtMeVsOmVjPU/eyPAoeTKQ7OyUXA22zMH4Ke6b5UuQhSeGOmYse0XhagI02rQ==" />
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
0