[ruby-core:63517] [ruby-trunk - Feature #10002] String swapcase

From: shyouhei@...
Date: 2014-07-02 09:00:12 UTC
List: ruby-core #63517
Issue #10002 has been updated by Shyouhei Urabe.


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.

If you think you can implement it, please show us.

Dāvis Mosāns wrote:
> It have been already figured out by [Unicode Standard](http://www.unicode.org/versions/Unicode6.3.0/), 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 [SpecialCasing.txt](http://www.unicode.org/Public/UNIDATA/SpecialCasing.txt) (and [UnicodeData.txt](http://www.unicode.org/Public/UNIDATA/UnicodeData.txt)) also [CaseFolding.txt](http://www.unicode.org/Public/UNIDATA/CaseFolding.txt) could be useful.
> 
> 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.
> 
> Also useful to read [Character Properties, Case Mappings & Names FAQ](http://www.unicode.org/faq/casemap_charprop.html)



----------------------------------------
Feature #10002: String swapcase
https://bugs.ruby-lang.org/issues/10002#change-47568

* Author: Andreas Runk
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
Hi, the ruby version 2.1.2 has a problem with the .swapcase function and german letters. 
E.g. `"ä".swapcase` does return "ä" but should be "Ä". 



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next