comparison xml/en/docs/njs/reference.xml @ 2884:ccd42f2b99fb

Deprecated several methods in njs reference.
author Yaroslav Zhuravlev <yar@nginx.com>
date Tue, 23 Aug 2022 14:51:52 +0100
parents e59e8645055d
children 155c8745f596
comparison
equal deleted inserted replaced
2883:4959250ba429 2884:ccd42f2b99fb
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="86"> 12 rev="87">
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
2397 </tag-desc> 2397 </tag-desc>
2398 2398
2399 <tag-name id="string_frombytes"><literal>String.prototype.fromBytes(<value>start</value>[, 2399 <tag-name id="string_frombytes"><literal>String.prototype.fromBytes(<value>start</value>[,
2400 <value>end</value>])</literal></tag-name> 2400 <value>end</value>])</literal></tag-name>
2401 <tag-desc> 2401 <tag-desc>
2402 Returns a new Unicode string from a byte string 2402 the property is deprecated since
2403 where each byte is replaced with a corresponding Unicode code point. 2403 <link doc="changes.xml" id="njs0.7.7">0.7.7</link>.
2404 Before <link doc="changes.xml" id="njs0.7.7">0.7.7</link>,
2405 returned a new Unicode string from a byte string
2406 where each byte was replaced with a corresponding Unicode code point.
2404 </tag-desc> 2407 </tag-desc>
2405 2408
2406 <tag-name id="string_fromutf8"><literal>String.prototype.fromUTF8(<value>start</value>[, 2409 <tag-name id="string_fromutf8"><literal>String.prototype.fromUTF8(<value>start</value>[,
2407 <value>end</value>])</literal></tag-name> 2410 <value>end</value>])</literal></tag-name>
2408 <tag-desc> 2411 <tag-desc>
2409 Converts a byte string containing a valid UTF-8 string 2412 the property is deprecated since
2413 <link doc="changes.xml" id="njs0.7.7">0.7.7</link>,
2414 the <link id="textedeoder"><literal>TextDecoder</literal></link> method
2415 should be used instead.
2416 Before <link doc="changes.xml" id="njs0.7.7">0.7.7</link>,
2417 converted a byte string containing a valid UTF-8 string
2410 into a Unicode string, 2418 into a Unicode string,
2411 otherwise <literal>null</literal> is returned. 2419 otherwise <literal>null</literal> was returned.
2412 </tag-desc> 2420 </tag-desc>
2413 2421
2414 <tag-name id="string_tobytes"><literal>String.prototype.toBytes(<value>start</value>[, 2422 <tag-name id="string_tobytes"><literal>String.prototype.toBytes(<value>start</value>[,
2415 <value>end</value>])</literal></tag-name> 2423 <value>end</value>])</literal></tag-name>
2416 <tag-desc> 2424 <tag-desc>
2417 Serializes a Unicode string to a byte string. 2425 the property is deprecated since
2418 Returns <literal>null</literal> if a character larger than 255 is 2426 <link doc="changes.xml" id="njs0.7.7">0.7.7</link>.
2427 Before <link doc="changes.xml" id="njs0.7.7">0.7.7</link>,
2428 serialized a Unicode string to a byte string,
2429 returned <literal>null</literal> if a character larger than 255 was
2419 found in the string. 2430 found in the string.
2420 </tag-desc> 2431 </tag-desc>
2421 2432
2422 <tag-name id="string_tostring"><literal>String.prototype.toString(<value>encoding</value>)</literal></tag-name> 2433 <tag-name id="string_tostring"><literal>String.prototype.toString(<value>encoding</value>)</literal></tag-name>
2423 <tag-desc> 2434 <tag-desc>
2424 <para> 2435 <para>
2425 Encodes a string to 2436 the property is deprecated since
2437 <link doc="changes.xml" id="njs0.7.7">0.7.7</link>.
2438 Before <link doc="changes.xml" id="njs0.7.7">0.7.7</link>,
2439 encoded a string to
2426 <literal>hex</literal>, 2440 <literal>hex</literal>,
2427 <literal>base64</literal>, or 2441 <literal>base64</literal>, or
2428 <literal>base64url</literal>: 2442 <literal>base64url</literal>:
2429 <example> 2443 <example>
2430 >> 'αβγδ'.toString('base64url') 2444 >> 'αβγδ'.toString('base64url')
2440 </tag-desc> 2454 </tag-desc>
2441 2455
2442 <tag-name id="string_toutf8"><literal>String.prototype.toUTF8(<value>start</value>[, 2456 <tag-name id="string_toutf8"><literal>String.prototype.toUTF8(<value>start</value>[,
2443 <value>end</value>])</literal></tag-name> 2457 <value>end</value>])</literal></tag-name>
2444 <tag-desc> 2458 <tag-desc>
2445 Serializes a Unicode string 2459 the property is deprecated since
2446 to a byte string using UTF-8 encoding. 2460 <link doc="changes.xml" id="njs0.7.7">0.7.7</link>,
2461 the <link id="textencoder"><literal>TextEncoder</literal></link> method
2462 should be used instead.
2463 Before <link doc="changes.xml" id="njs0.7.7">0.7.7</link>,
2464 serialized a Unicode string
2465 to a byte string using UTF-8 encoding:
2447 <example> 2466 <example>
2448 >> 'αβγδ'.toUTF8().length 2467 >> 'αβγδ'.toUTF8().length
2449 8 2468 8
2450 >> 'αβγδ'.length 2469 >> 'αβγδ'.length
2451 4 2470 4