https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112014-07-01T18:21:20ZRuby Issue Tracking SystemRuby master - Feature #10002: String swapcasehttps://bugs.ruby-lang.org/issues/10002?journal_id=475202014-07-01T18:21:20Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Feature</i></li></ul> Ruby master - Feature #10002: String swapcasehttps://bugs.ruby-lang.org/issues/10002?journal_id=475222014-07-02T00:09:11Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul></ul><p>The current implementation of case conversion methods in String class only understands ASCII characters.<br>
We'd like to enhance it when possible. But we have to know how each character should be converted.<br>
For example, how should we convert "ß" (eszett)?</p>
<p>Matz.</p> Ruby master - Feature #10002: String swapcasehttps://bugs.ruby-lang.org/issues/10002?journal_id=475232014-07-02T01:11:50Znaruse (Yui NARUSE)naruse@airemix.jp
<ul></ul><p>At this time, <a href="https://github.com/jarib/ffi-icu" class="external">ffi-icu</a> or <a href="https://github.com/twitter/twitter-cldr-rb" class="external">twitter-text-rb</a> is useful.</p> Ruby master - Feature #10002: String swapcasehttps://bugs.ruby-lang.org/issues/10002?journal_id=475242014-07-02T01:15:06Zdavispuh (Dāvis Mosāns)
<ul></ul><p>It have been already figured out by <a href="http://www.unicode.org/versions/Unicode6.3.0/" class="external">Unicode Standard</a>, so just have to implement it. Look at Default Case Algorithms in section 3.13 and Case Mappings in section 5.18. Mappings can be viewed in <a href="http://www.unicode.org/Public/UNIDATA/SpecialCasing.txt" class="external">SpecialCasing.txt</a> (and <a href="http://www.unicode.org/Public/UNIDATA/UnicodeData.txt" class="external">UnicodeData.txt</a>) also <a href="http://www.unicode.org/Public/UNIDATA/CaseFolding.txt" class="external">CaseFolding.txt</a> could be useful.</p>
<p>From there "ß" (LATIN SMALL LETTER SHARP S) in uppercase would be "SS" (LATIN CAPITAL LETTER S) and it's user's responsibility to know that generally they are not reversible.</p>
<p>Also useful to read <a href="http://www.unicode.org/faq/casemap_charprop.html" class="external">Character Properties, Case Mappings & Names FAQ</a></p> Ruby master - Feature #10002: String swapcasehttps://bugs.ruby-lang.org/issues/10002?journal_id=475262014-07-02T01:51:42Zzzak (zzak _)
<ul></ul><p>We should delegate to @<em>emboss</em> everytime we need to convert ß...</p> Ruby master - Feature #10002: String swapcasehttps://bugs.ruby-lang.org/issues/10002?journal_id=475682014-07-02T09:00:11Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul></ul><p>We are talking about swapcase, not folding. The "generally they are not reversible" you say is the difficulty we are facing here. Also as you cited CaseFolding.txt, you should have been aware of type T folding, which is impossible without locale information.</p>
<p>If you think you can implement it, please show us.</p>
<p>Dāvis Mosāns wrote:</p>
<blockquote>
<p>It have been already figured out by <a href="http://www.unicode.org/versions/Unicode6.3.0/" class="external">Unicode Standard</a>, so just have to implement it. Look at Default Case Algorithms in section 3.13 and Case Mappings in section 5.18. Mappings can be viewed in <a href="http://www.unicode.org/Public/UNIDATA/SpecialCasing.txt" class="external">SpecialCasing.txt</a> (and <a href="http://www.unicode.org/Public/UNIDATA/UnicodeData.txt" class="external">UnicodeData.txt</a>) also <a href="http://www.unicode.org/Public/UNIDATA/CaseFolding.txt" class="external">CaseFolding.txt</a> could be useful.</p>
<p>From there "ß" (LATIN SMALL LETTER SHARP S) in uppercase would be "SS" (LATIN CAPITAL LETTER S) and it's user's responsibility to know that generally they are not reversible.</p>
<p>Also useful to read <a href="http://www.unicode.org/faq/casemap_charprop.html" class="external">Character Properties, Case Mappings & Names FAQ</a></p>
</blockquote> Ruby master - Feature #10002: String swapcasehttps://bugs.ruby-lang.org/issues/10002?journal_id=479892014-07-23T11:07:13Zduerst (Martin Dürst)duerst@it.aoyama.ac.jp
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/10085">Feature #10085</a>: Add non-ASCII case conversion to String#upcase/downcase/swapcase/capitalize</i> added</li></ul> Ruby master - Feature #10002: String swapcasehttps://bugs.ruby-lang.org/issues/10002?journal_id=654702017-06-26T06:45:56Zduerst (Martin Dürst)duerst@it.aoyama.ac.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>This has actually been implemented by Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Add non-ASCII case conversion to String#upcase/downcase/swapcase/capitalize (Closed)" href="https://bugs.ruby-lang.org/issues/10085">#10085</a>, so it can be closed.</p>