blob: b2da7aeebf656b51415fac3e0e208cb1e5fb6e59 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
---
title: ByteString
slug: conflicting/Web/JavaScript/Reference/Global_Objects/String
tags:
- API
- DOM
- String
- WebIDL
- 参考
- 字符串
translation_of: Web/API/ByteString
original_slug: Web/API/ByteString
---
<p>{{APIRef("DOM")}}</p>
<p><strong><code>ByteString</code></strong> 是一个可以对应所有可能的字节序列的 UTF-8 字符串。在 JavaScript 中,当返回时 <code>ByteString</code> 时,它会映射到一个 {{jsxref("String")}} 上去; 通常,只有在和一些协议交互,进行字节和字符串的相互转换时,它才会被用到,例如 HTTP 协议。</p>
<h2 id="Specification" name="Specification">规范</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">规范</th>
<th scope="col">状态</th>
<th scope="col">备注</th>
</tr>
<tr>
<td>{{SpecName('WebIDL', '#idl-ByteString', 'ByteString')}}</td>
<td>{{Spec2('WebIDL')}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="参见">参见</h2>
<ul>
<li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" title="/en-US/docs/Web/API/DOMString">String</a></li>
<li><a href="/en-US/docs/Web/JavaScript/Typed_arrays/String_view" title="/en-US/docs/Web/JavaScript/Typed_arrays/String_view"><code>StringView</code> – a C-like representation of strings based on typed arrays</a></li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/API/DOMString/Binary">Binary strings</a></li>
</ul>
|