Unicode strings: Difference between revisions

Content added Content deleted
m (→‎{{header|Scala}}: Rm Scala imp category)
(→‎{{header|Ruby}}: added unicode normalisation)
Line 887: Line 887:
puts Σ([4,5,6]) #=>15
puts Σ([4,5,6]) #=>15
</lang>
</lang>
Ruby 2.2 introduced a method to normalize unicode strings:
The unicode gem (an external library) is for difficult things like normalization and lowercase\uppercase outside the ASCII region.
<lang ruby>
p bad = "¿como\u0301 esta\u0301s?" # => "¿comó estás?"
p bad.unicode_normalized? # => false
p bad.unicode_normalize! # => "¿comó estás?"
p bad.unicode_normalized? # => true
</lang>

The unicode gem (an external library) is for difficult things like lowercase\uppercase outside the ASCII region.


=={{header|Scala}}==
=={{header|Scala}}==