Unicode strings: Difference between revisions
→{{header|Ruby}}: added unicode normalisation
m (→{{header|Scala}}: Rm Scala imp category) |
(→{{header|Ruby}}: added unicode normalisation) |
||
Line 887:
puts Σ([4,5,6]) #=>15
</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
=={{header|Scala}}==
|