Jump to content

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 focussesfocuses on encodings (exactly 100 encodings are supported in Ruby 2.1.0,) theit defaultincludes beingpretty much all known Unicode Transformation Formats, including UTF-8 which is the default encoding since 2.1.0) .
 
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}/.
 
Unicode codestrings isare no problem:
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}}==
1,149

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.