[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 rev=
ersible" you say is the difficulty we are facing here.  Also as you cited C=
aseFolding.txt, you should have been aware of type T folding, which is impo=
ssible without locale information.

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

D=C4=81vis Mos=C4=81ns 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. Mapping=
s can be viewed in [SpecialCasing.txt](http://www.unicode.org/Public/UNIDAT=
A/SpecialCasing.txt) (and [UnicodeData.txt](http://www.unicode.org/Public/U=
NIDATA/UnicodeData.txt)) also [CaseFolding.txt](http://www.unicode.org/Publ=
ic/UNIDATA/CaseFolding.txt) could be useful.
>=20
> From there "=C3=9F" (LATIN SMALL LETTER SHARP S) in uppercase would be "S=
S" (LATIN CAPITAL LETTER S) and it's user's responsibility to know that gen=
erally they are not reversible.
>=20
> Also useful to read [Character Properties, Case Mappings & Names FAQ](htt=
p://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:=20
* Category:=20
* Target version:=20
----------------------------------------
Hi, the ruby version 2.1.2 has a problem with the .swapcase function and ge=
rman letters.=20
E.g. `"=C3=A4".swapcase` does return "=C3=A4" but should be "=C3=84".=20



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

In This Thread

Prev Next