# HG changeset patch # User Yaroslav Zhuravlev # Date 1616178274 0 # Node ID dd2bbd104146d792656387177add401638c83871 # Parent 7ff9d8bda7573b67332d5ffa596add4cffd9f8fd Unified spelling of UTF-8 in njs. Rules for spelling UTF-8 in njs Reference: - utf8 when it is a value - UTF-8 when it is a part of a text diff -r 7ff9d8bda757 -r dd2bbd104146 xml/en/docs/njs/reference.xml --- a/xml/en/docs/njs/reference.xml Fri Mar 19 18:24:34 2021 +0000 +++ b/xml/en/docs/njs/reference.xml Fri Mar 19 18:24:34 2021 +0000 @@ -9,7 +9,7 @@
+ rev="71">
@@ -233,7 +233,7 @@ the same as r.requestBuffer, but returns a string. Note that -it may convert bytes invalid in utf8 encoding into the replacement character. +it may convert bytes invalid in UTF-8 encoding into the replacement character. r.rawHeadersIn{} @@ -305,7 +305,7 @@ but returns a string (since 0.5.0). Note that -it may convert bytes invalid in utf8 encoding into the replacement character. +it may convert bytes invalid in UTF-8 encoding into the replacement character. r.return(status[, @@ -973,10 +973,10 @@ and are used to serialize Unicode strings to external data and deserialize from external sources. For example, the toUTF8() method serializes -a Unicode string to a byte string using UTF8 encoding: +a Unicode string to a byte string using UTF-8 encoding: >> '£'.toUTF8().toString('hex') -'c2a3' /* C2 A3 is the UTF8 representation of 00A3 ('£') code point */ +'c2a3' /* C2 A3 is the UTF-8 representation of 00A3 ('£') code point */ The toBytes() method serializes a Unicode string with code points up to 255 into a byte string, @@ -1020,7 +1020,7 @@ String.prototype.fromUTF8(start[, end]) -Converts a byte string containing a valid UTF8 string +Converts a byte string containing a valid UTF-8 string into a Unicode string, otherwise null is returned. @@ -1057,7 +1057,7 @@ end]) Serializes a Unicode string -to a byte string using UTF8 encoding. +to a byte string using UTF-8 encoding. >> 'αβγδ'.toUTF8().length 8