-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
i18n: Locale-aware quoting #8179
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
Conversation
98d25ad to
9715f06
Compare
|
Force pushed to add License headers and reformat (diff) |
48554a2 to
820134e
Compare
f104f7d to
320aae1
Compare
|
GNU testsuite comparison: |
|
Referencing issues that could be fixed thanks to this patch: |
6513a29 to
5dbd1ef
Compare
|
GNU testsuite comparison: |
5dbd1ef to
9ad4f01
Compare
|
GNU testsuite comparison: |
9ad4f01 to
5237962
Compare
|
GNU testsuite comparison: |
1921183 to
3fe7f94
Compare
|
GNU testsuite comparison: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RenjiSann is it intentional that this file is in test and not somewhere in tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, that's a remainder of me testing stuff :/
I will open a merge request to revert it
This PR brings initial support for Locale-aware quoting.
Basically, the code fetches the locale data (for now it looks at
LC_ALLandLC_COLLATE, might have to fix it in the future).It will parse the second part of the locale if existing to deduce the encoding:
C.UTF-8,fr_FR.UTF-8are UTF-8 encoded, whileen_USandCdefault to simple ASCII (should be ISO-8859-1, but there is no support for it right now).Disclaimer: Right now, only UTF-8 and ASCII encodings are supported. Further support will be discussed as it may be less trivial to implement.
In order to do this, I've heavily refactored the
quoting_stylecode:Quotertrait to factorize the interface of all quoting mechanismspush_char()orpush_invalid()depending on the encoding.