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

From: davispuh@...
Date: 2014-07-02 01:15:06 UTC
List: ruby-core #63481
Issue #10002 has been updated by Dāvis Mosāns.


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-47524

* 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