Don't escape U+FF9E and U+FF9F in escape_debug_ext - #158057
Conversation
|
r? @Darksonn rustbot has assigned @Darksonn. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| _ if self.is_control() | ||
| || self.is_private_use() | ||
| || self.is_whitespace() | ||
| || args.escape_grapheme_extender && self.is_grapheme_extender() | ||
| || self.is_default_ignorable() | ||
| || self.is_format_control() | ||
| || self.is_unassigned() => | ||
| { | ||
| EscapeDebug::unicode(self) |
There was a problem hiding this comment.
Which category does it fall into today? What sort of other things are in that category? It seems like a really weird exception, and I can't help but wonder whether it's one of these methods that should be fixed instead.
There was a problem hiding this comment.
They fall under is_grapheme_extender(). https://www.unicode.org/versions/latest/core-spec/chapter-3/#G41165 is the description of this category in the Unicode standard (which explicitly special-cases these two characters). https://util.unicode.org/UnicodeJsps/list-unicodeset.jsp?a=%5B%3AGrapheme_Extend%3A%5D is the full list of characters in the category
There was a problem hiding this comment.
If I set escape_grapheme_extender, then I would expect it to escape all grapheme extenders.
There was a problem hiding this comment.
I added a note to the field's doc comment.
|
Could you give an example of a string whose |
|
An example string that would be affected: |
There was a problem hiding this comment.
Well, with my somewhat limited but non-zero knowledge of japanese, I do agree that ペンギン should ideally be printed without escaping, and I also understand why it makes sense for them to be considered "part" of the current character even if they do not stack on top of the previous character.
So I'm going to review this PR with the assumption that we want to make this change now, but I do agree that an FCP would be ideal for this behavior change.
|
cc @Amanieu can you help with whether FCP is needed? Thanks! |
|
When in doubt, just add the label to nominate for discussion in the next libs-api meeting. |
|
cc @Manishearth as our Unicode Knower, if this seems reasonable to you we're okay shipping this |
|
@joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
And also, is there something we could get from the unicode consortium to make this less adhoc? |
I doubt it. It's debug output, there's not much use in a detailed standard for that. |
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
|
@rustbot ready |
|
📋 This PR cannot be approved because it currently has the following label: |
|
@bors r+ |
…noescape, r=Darksonn Don't escape U+FF9E and U+FF9F in `escape_debug_ext` The two characters `゙` U+FF9E HALFWIDTH KATAKANA VOICED SOUND MARK and `゚` U+FF9F HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK are the odd ones out when it comes to grapheme extenders, in that *graphically* they are not combining at all. See microsoft/terminal#18087 for more background on these characters. I think this needs FCP? It affects `char::escape_debug`, and various `Debug` impls for characters and strings. @rustbot labels T-libs-api needs-fcp A-Unicode
…noescape, r=Darksonn Don't escape U+FF9E and U+FF9F in `escape_debug_ext` The two characters `゙` U+FF9E HALFWIDTH KATAKANA VOICED SOUND MARK and `゚` U+FF9F HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK are the odd ones out when it comes to grapheme extenders, in that *graphically* they are not combining at all. See microsoft/terminal#18087 for more background on these characters. I think this needs FCP? It affects `char::escape_debug`, and various `Debug` impls for characters and strings. @rustbot labels T-libs-api needs-fcp A-Unicode
…uwer Rollup of 8 pull requests Successful merges: - #159817 (Rename splat to avoid stable name collisions) - #158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`) - #159818 (Resolve vars before calling `unnormalized_obligations`) - #160040 (Split function parsing out of `item.rs` to a new module.) - #160044 (Add regression tests for fixed dead-code issues) - #160147 (tests: Remove `-Zthreads` options from tests in `ui/parallel-rustc`) - #160175 (Try to recover less from incorrectly parsed const arg) - #160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`)
…noescape, r=Darksonn Don't escape U+FF9E and U+FF9F in `escape_debug_ext` The two characters `゙` U+FF9E HALFWIDTH KATAKANA VOICED SOUND MARK and `゚` U+FF9F HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK are the odd ones out when it comes to grapheme extenders, in that *graphically* they are not combining at all. See microsoft/terminal#18087 for more background on these characters. I think this needs FCP? It affects `char::escape_debug`, and various `Debug` impls for characters and strings. @rustbot labels T-libs-api needs-fcp A-Unicode
Rollup of 14 pull requests Successful merges: - #159817 (Rename splat to avoid stable name collisions) - #160204 (Sync from portable simd 2026 07 30) - #150885 (Revive L4Re target) - #158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`) - #160125 (Fix typing mode handling in transmute checks and rustc_dump_layout) - #160152 (Create on-demand CI job for testing EC2 instances) - #159214 (std: improve the documentation of the random feature) - #159818 (Resolve vars before calling `unnormalized_obligations`) - #160040 (Split function parsing out of `item.rs` to a new module.) - #160044 (Add regression tests for fixed dead-code issues) - #160144 (renovate: group lockfiles PRs) - #160149 (Fix Windows on Arm PAC default) - #160175 (Try to recover less from incorrectly parsed const arg) - #160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`)
…uwer Rollup of 25 pull requests Successful merges: - #160204 (Sync from portable simd 2026 07 30) - #138230 (Add `raw_borrows_via_references` lint) - #158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`) - #160015 (refactor(mir-transform): Merge `can_be_overridden`, `is_required` and `is_enabled` into one) - #160031 (std: make positioned I/O unsupported on VxWorks) - #160125 (Fix typing mode handling in transmute checks and rustc_dump_layout) - #160152 (Create on-demand CI job for testing EC2 instances) - #160232 (rustdoc: fix ICE when a grapheme cluster joins a Prepend-class character to `_` or `:`) - #159214 (std: improve the documentation of the random feature) - #159818 (Resolve vars before calling `unnormalized_obligations`) - #159955 (Stop using higher-order macros to declare arenas) - #159958 (Fix avoid cycle for self referential return type notation) - #160040 (Split function parsing out of `item.rs` to a new module.) - #160044 (Add regression tests for fixed dead-code issues) - #160144 (renovate: group lockfiles PRs) - #160149 (Fix Windows on Arm PAC default) - #160164 (Derive `GenericTypeVisitable` for `RegionConstraint`) - #160175 (Try to recover less from incorrectly parsed const arg) - #160177 (A few more "predicate"-to-"clause" renamings) - #160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`) - #160192 (Fix ICE for parsing issue with a closing brace) - #160209 (bootstrap: Remove method `Subcommand::kind`) - #160221 (Remove `Copy` supertrait from `VaList`) - #160223 (interpret: rename validate_operand → validate_place) - #160234 (Always use short ty path for call with missing arguments suggestion)
…uwer Rollup of 25 pull requests Successful merges: - #160204 (Sync from portable simd 2026 07 30) - #138230 (Add `raw_borrows_via_references` lint) - #158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`) - #160015 (refactor(mir-transform): Merge `can_be_overridden`, `is_required` and `is_enabled` into one) - #160031 (std: make positioned I/O unsupported on VxWorks) - #160125 (Fix typing mode handling in transmute checks and rustc_dump_layout) - #160152 (Create on-demand CI job for testing EC2 instances) - #160232 (rustdoc: fix ICE when a grapheme cluster joins a Prepend-class character to `_` or `:`) - #159214 (std: improve the documentation of the random feature) - #159818 (Resolve vars before calling `unnormalized_obligations`) - #159955 (Stop using higher-order macros to declare arenas) - #159958 (Fix avoid cycle for self referential return type notation) - #160040 (Split function parsing out of `item.rs` to a new module.) - #160044 (Add regression tests for fixed dead-code issues) - #160144 (renovate: group lockfiles PRs) - #160149 (Fix Windows on Arm PAC default) - #160164 (Derive `GenericTypeVisitable` for `RegionConstraint`) - #160175 (Try to recover less from incorrectly parsed const arg) - #160177 (A few more "predicate"-to-"clause" renamings) - #160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`) - #160192 (Fix ICE for parsing issue with a closing brace) - #160209 (bootstrap: Remove method `Subcommand::kind`) - #160221 (Remove `Copy` supertrait from `VaList`) - #160223 (interpret: rename validate_operand → validate_place) - #160234 (Always use short ty path for call with missing arguments suggestion)
Rollup merge of #158057 - Jules-Bertholet:halfwidth-dakuten-noescape, r=Darksonn Don't escape U+FF9E and U+FF9F in `escape_debug_ext` The two characters `゙` U+FF9E HALFWIDTH KATAKANA VOICED SOUND MARK and `゚` U+FF9F HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK are the odd ones out when it comes to grapheme extenders, in that *graphically* they are not combining at all. See microsoft/terminal#18087 for more background on these characters. I think this needs FCP? It affects `char::escape_debug`, and various `Debug` impls for characters and strings. @rustbot labels T-libs-api needs-fcp A-Unicode
…uwer Rollup of 25 pull requests Successful merges: - rust-lang/rust#160204 (Sync from portable simd 2026 07 30) - rust-lang/rust#138230 (Add `raw_borrows_via_references` lint) - rust-lang/rust#158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`) - rust-lang/rust#160015 (refactor(mir-transform): Merge `can_be_overridden`, `is_required` and `is_enabled` into one) - rust-lang/rust#160031 (std: make positioned I/O unsupported on VxWorks) - rust-lang/rust#160125 (Fix typing mode handling in transmute checks and rustc_dump_layout) - rust-lang/rust#160152 (Create on-demand CI job for testing EC2 instances) - rust-lang/rust#160232 (rustdoc: fix ICE when a grapheme cluster joins a Prepend-class character to `_` or `:`) - rust-lang/rust#159214 (std: improve the documentation of the random feature) - rust-lang/rust#159818 (Resolve vars before calling `unnormalized_obligations`) - rust-lang/rust#159955 (Stop using higher-order macros to declare arenas) - rust-lang/rust#159958 (Fix avoid cycle for self referential return type notation) - rust-lang/rust#160040 (Split function parsing out of `item.rs` to a new module.) - rust-lang/rust#160044 (Add regression tests for fixed dead-code issues) - rust-lang/rust#160144 (renovate: group lockfiles PRs) - rust-lang/rust#160149 (Fix Windows on Arm PAC default) - rust-lang/rust#160164 (Derive `GenericTypeVisitable` for `RegionConstraint`) - rust-lang/rust#160175 (Try to recover less from incorrectly parsed const arg) - rust-lang/rust#160177 (A few more "predicate"-to-"clause" renamings) - rust-lang/rust#160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`) - rust-lang/rust#160192 (Fix ICE for parsing issue with a closing brace) - rust-lang/rust#160209 (bootstrap: Remove method `Subcommand::kind`) - rust-lang/rust#160221 (Remove `Copy` supertrait from `VaList`) - rust-lang/rust#160223 (interpret: rename validate_operand → validate_place) - rust-lang/rust#160234 (Always use short ty path for call with missing arguments suggestion)
…uwer Rollup of 25 pull requests Successful merges: - rust-lang/rust#160204 (Sync from portable simd 2026 07 30) - rust-lang/rust#138230 (Add `raw_borrows_via_references` lint) - rust-lang/rust#158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`) - rust-lang/rust#160015 (refactor(mir-transform): Merge `can_be_overridden`, `is_required` and `is_enabled` into one) - rust-lang/rust#160031 (std: make positioned I/O unsupported on VxWorks) - rust-lang/rust#160125 (Fix typing mode handling in transmute checks and rustc_dump_layout) - rust-lang/rust#160152 (Create on-demand CI job for testing EC2 instances) - rust-lang/rust#160232 (rustdoc: fix ICE when a grapheme cluster joins a Prepend-class character to `_` or `:`) - rust-lang/rust#159214 (std: improve the documentation of the random feature) - rust-lang/rust#159818 (Resolve vars before calling `unnormalized_obligations`) - rust-lang/rust#159955 (Stop using higher-order macros to declare arenas) - rust-lang/rust#159958 (Fix avoid cycle for self referential return type notation) - rust-lang/rust#160040 (Split function parsing out of `item.rs` to a new module.) - rust-lang/rust#160044 (Add regression tests for fixed dead-code issues) - rust-lang/rust#160144 (renovate: group lockfiles PRs) - rust-lang/rust#160149 (Fix Windows on Arm PAC default) - rust-lang/rust#160164 (Derive `GenericTypeVisitable` for `RegionConstraint`) - rust-lang/rust#160175 (Try to recover less from incorrectly parsed const arg) - rust-lang/rust#160177 (A few more "predicate"-to-"clause" renamings) - rust-lang/rust#160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`) - rust-lang/rust#160192 (Fix ICE for parsing issue with a closing brace) - rust-lang/rust#160209 (bootstrap: Remove method `Subcommand::kind`) - rust-lang/rust#160221 (Remove `Copy` supertrait from `VaList`) - rust-lang/rust#160223 (interpret: rename validate_operand → validate_place) - rust-lang/rust#160234 (Always use short ty path for call with missing arguments suggestion)
View all comments
The two characters
゙U+FF9E HALFWIDTH KATAKANA VOICED SOUND MARK and゚U+FF9F HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK are the odd ones out when it comes to grapheme extenders, in that graphically they are not combining at all. See microsoft/terminal#18087 for more background on these characters.I think this needs FCP? It affects
char::escape_debug, and variousDebugimpls for characters and strings.@rustbot labels T-libs-api needs-fcp A-Unicode