Unicode strings: Difference between revisions
→{{header|Ruby}}: Made more clear that it is easy to use Unicode, even without specific support.
(→{{header|Go}}: Update info on normalization support; add link to highly relevant official Go blog article; other tweaks) |
(→{{header|Ruby}}: Made more clear that it is easy to use Unicode, even without specific support.) |
||
Line 870:
=={{header|Ruby}}==
Ruby has hardly any specific support for Unicode; however since it
Most support is to be found in the Regexp engine, for instance /\p{Sc}/ matches everything from the Symbol: Currency category; \p{} matches a character’s Unicode script, like /\p{Linear_B}/.
The unicode gem (an external library) is for difficult things like normalization and lowercase\uppercase outside the ASCII region.▼
<lang ruby>str = "你好"
▲Unicode code is no problem:
str.include?("好") # => true</lang>
Unicode code is no problem either:
<lang ruby>def Σ(array)
Line 884 ⟶ 887:
puts Σ([4,5,6]) #=>15
</lang>
▲The unicode gem (an external library) is for difficult things like normalization and lowercase\uppercase outside the ASCII region.
=={{header|Scala}}==
|