-
Notifications
You must be signed in to change notification settings - Fork 218
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
Support non-ASCII characters in ISO-8859-x charsets #3310
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
3bcf57f
Add the mapping dictionary for all ISO-8859-x encodings
seisman 4738815
Add a function to check the encoding of a string
seisman 9f0e0f1
Add the encoding parameter to non_ascii_to_octal
seisman 21e91f1
Improve build_arg_list to make it support ISO-8859-x encodings
seisman 01ef6b3
Let Figure.text to support ISO-8859-x encodings
seisman 3c8b979
Update examples/gallery/images/rgb_image.py
seisman d946636
Add doctests for check_encoding
seisman 7aa07a0
Add doctest for non_ascii_to_octal
seisman 6f3aae4
Add doctests to build_arg_list
seisman e2fa2c8
Add a test for ISO-8859-x characters
seisman dca5079
Merge branch 'main' into iso-encoding
seisman 32a6646
Update documentation
seisman db590a3
Update doc/techref/encodings.md
seisman 7c9bed4
Revert changes in examples/gallery/images/rgb_image.py
seisman 91818e1
Fix links
seisman 9af4efb
Merge remote-tracking branch 'origin/iso-encoding' into iso-encoding
seisman 4734520
Apply suggestions from code review
seisman df3679b
Merge branch 'main' into iso-encoding
seisman 36b2a2f
Fix a markdown link
seisman 78cc52b
Merge branch 'main' into iso-encoding
seisman 2d01f6b
Check_encoding now returns 'ascii' if the string only contains ASCII …
seisman 43ef0a2
Update the docstrings in Figure.text
seisman 586127d
Merge branch 'main' into iso-encoding
seisman e8ac6bb
Merge branch 'main' into iso-encoding
seisman 6bd5008
Merge branch 'main' into iso-encoding
seisman 5260749
Merge branch 'main' into iso-encoding
seisman 556fee9
Update docstrings
seisman c414b4c
Fix a docstring
seisman 7607c7e
Improve docstrings of check_encoding and non_ascii_to_octal
seisman 6728856
Make check_encoding function private
seisman 7a26bfc
non_ascii_to_otcal: return immediately if encoding is ascii
seisman 1636453
Improve Figure.text docstrings
seisman d90dcc8
Improve docs
seisman 23a2806
Move private function _check_encoding to the top
seisman 3474bb2
Silent a mypy warning
seisman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
outs: | ||
- md5: a0f35a1d58c95e6589c7397e7660e946 | ||
size: 17089 | ||
hash: md5 | ||
path: test_text_nonascii_iso8859.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This block assumes that there will only be one encoding type? To support multiple encodings in different arguments, maybe change it to something like this (untested):
But this can be done in a separate PR perhaps. I'm not sure how common it is to mix encodings in different arguments.
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.
It's not possible in GMT. For each GMT module call, we can only pass
--PS_CHAR_ENCODING
once, so it means that all the arguments in a GMT call must be in the same encoding.For
Figure.text
, thetext
string and any arguments also must use the same encoding.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.
If people use mixed encodings in different arguments, the default
ISOLatin1+
encoding is used.