File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ Standard library changes
6464 * ` Base.@kwdef ` can now be used for parametric structs, and for structs with supertypes ([ #29316 ] ).
6565 * ` merge(::NamedTuple, ::NamedTuple...) ` can now be used with more than 2 ` NamedTuple ` s ([ #29259 ] ).
6666 * ` Future.copy! ` has been moved to ` Base ` ([ #29178 ] ).
67+ * New ` ncodeunits(c::Char) ` method as a fast equivalent to ` ncodeunits(string(c)) ` ([ #29153 ] ).
6768
6869Compiler/Runtime improvements
6970-----------------------------
Original file line number Diff line number Diff line change 5656Return the number of code units required to encode a character as UTF-8.
5757This is the number of bytes which will be printed if the character is written
5858to an output stream, or `ncodeunits(string(c))` but computed efficiently.
59+
60+ !!! compat "Julia 1.1"
61+ This method requires at least Julia 1.1. In Julia 1.0 consider
62+ using `ncodeunits(string(c))`.
5963"""
6064ncodeunits (c:: Char ) = write (devnull , c) # this is surprisingly efficient
6165
You can’t perform that action at this time.
0 commit comments