Mercurial > hg > nginx-site
comparison xml/en/docs/njs/reference.xml @ 2631:7da360f50017
Unified spelling of "utf-8" in njs.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Fri, 04 Dec 2020 12:26:13 +0000 |
parents | e203e1106fb2 |
children | 0085d9f7dc3f |
comparison
equal
deleted
inserted
replaced
2630:e203e1106fb2 | 2631:7da360f50017 |
---|---|
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> | 7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> |
8 | 8 |
9 <article name="Reference" | 9 <article name="Reference" |
10 link="/en/docs/njs/reference.html" | 10 link="/en/docs/njs/reference.html" |
11 lang="en" | 11 lang="en" |
12 rev="58"> | 12 rev="59"> |
13 | 13 |
14 <section id="summary"> | 14 <section id="summary"> |
15 | 15 |
16 <para> | 16 <para> |
17 <link doc="index.xml">njs</link> provides objects, methods and properties | 17 <link doc="index.xml">njs</link> provides objects, methods and properties |
1015 <literal>TypedArray</literal>, | 1015 <literal>TypedArray</literal>, |
1016 <literal>DataView</literal>, or | 1016 <literal>DataView</literal>, or |
1017 <literal>ArrayBuffer</literal>. | 1017 <literal>ArrayBuffer</literal>. |
1018 If the value is a <value>string</value>, | 1018 If the value is a <value>string</value>, |
1019 the <literal>encoding</literal> parameter is its encoding, can be | 1019 the <literal>encoding</literal> parameter is its encoding, can be |
1020 <value>utf-8</value>, | 1020 <value>utf8</value>, |
1021 <value>hex</value>, | 1021 <value>hex</value>, |
1022 <value>base64</value>, | 1022 <value>base64</value>, |
1023 <value>base64url</value>; | 1023 <value>base64url</value>; |
1024 by default is <value>utf-8</value>. | 1024 by default is <value>utf8</value>. |
1025 </tag-desc> | 1025 </tag-desc> |
1026 | 1026 |
1027 <tag-name id="buffer_compare"><literal>Buffer.compare(<value>buffer1</value>, | 1027 <tag-name id="buffer_compare"><literal>Buffer.compare(<value>buffer1</value>, |
1028 <value>buffer2</value>)</literal></tag-name> | 1028 <value>buffer2</value>)</literal></tag-name> |
1029 <tag-desc> | 1029 <tag-desc> |
1094 <tag-desc> | 1094 <tag-desc> |
1095 Creates a new Buffer with a <value>string</value>. | 1095 Creates a new Buffer with a <value>string</value>. |
1096 The <value>encoding</value> parameter identifies the character encoding | 1096 The <value>encoding</value> parameter identifies the character encoding |
1097 to be used when converting a string into bytes. | 1097 to be used when converting a string into bytes. |
1098 The encoding can be | 1098 The encoding can be |
1099 <literal>utf-8</literal>, | 1099 <literal>utf8</literal>, |
1100 <literal>hex</literal>, | 1100 <literal>hex</literal>, |
1101 <literal>base64</literal>, | 1101 <literal>base64</literal>, |
1102 <literal>base64url</literal>; | 1102 <literal>base64url</literal>; |
1103 by default is <literal>utf-8</literal>. | 1103 by default is <literal>utf8</literal>. |
1104 </tag-desc> | 1104 </tag-desc> |
1105 | 1105 |
1106 <tag-name id="buffer_is_buffer"><literal>Buffer.isBuffer(<value>object</value>)</literal></tag-name> | 1106 <tag-name id="buffer_is_buffer"><literal>Buffer.isBuffer(<value>object</value>)</literal></tag-name> |
1107 <tag-desc> | 1107 <tag-desc> |
1108 A boolean value, | 1108 A boolean value, |
1226 Returns an integer which is the index of the first occurrence of | 1226 Returns an integer which is the index of the first occurrence of |
1227 <value>value</value> in Buffer, or <value>-1</value> | 1227 <value>value</value> in Buffer, or <value>-1</value> |
1228 if Buffer does not contain value. | 1228 if Buffer does not contain value. |
1229 The <value>value</value> can be a | 1229 The <value>value</value> can be a |
1230 <literal>string</literal> with specified <value>encoding</value> | 1230 <literal>string</literal> with specified <value>encoding</value> |
1231 (by default <value>utf-8</value>), | 1231 (by default <value>utf8</value>), |
1232 <literal>Buffer</literal>, | 1232 <literal>Buffer</literal>, |
1233 <literal>Unit8Array</literal>, | 1233 <literal>Unit8Array</literal>, |
1234 or a number between 0 and 255. | 1234 or a number between 0 and 255. |
1235 </tag-desc> | 1235 </tag-desc> |
1236 | 1236 |
1411 <value>start</value>[, | 1411 <value>start</value>[, |
1412 <value>end</value>]]])</literal></tag-name> | 1412 <value>end</value>]]])</literal></tag-name> |
1413 <tag-desc> | 1413 <tag-desc> |
1414 Decodes <literal>buf</literal> to a string | 1414 Decodes <literal>buf</literal> to a string |
1415 according to the specified character <value>encoding</value>. | 1415 according to the specified character <value>encoding</value>. |
1416 which can be <value>utf-8</value>, | 1416 which can be <value>utf8</value>, |
1417 <value>hex</value>, | 1417 <value>hex</value>, |
1418 <value>base64</value>, | 1418 <value>base64</value>, |
1419 <value>base64url</value>. | 1419 <value>base64url</value>. |
1420 The <value>start</value> and <value>end</value> parameters | 1420 The <value>start</value> and <value>end</value> parameters |
1421 may be passed to decode only a subset of Buffer. | 1421 may be passed to decode only a subset of Buffer. |
1432 The <value>length</value> parameter is the number of bytes to write. | 1432 The <value>length</value> parameter is the number of bytes to write. |
1433 If Buffer did not contain enough space to fit the entire string, | 1433 If Buffer did not contain enough space to fit the entire string, |
1434 only part of string will be written, | 1434 only part of string will be written, |
1435 however, partially encoded characters will not be written. | 1435 however, partially encoded characters will not be written. |
1436 The <value>encoding</value> can be | 1436 The <value>encoding</value> can be |
1437 <value>utf-8</value>, | 1437 <value>utf8</value>, |
1438 <value>hex</value>, | 1438 <value>hex</value>, |
1439 <value>base64</value>, | 1439 <value>base64</value>, |
1440 <value>base64url</value>. | 1440 <value>base64url</value>. |
1441 </tag-desc> | 1441 </tag-desc> |
1442 | 1442 |