问题标签 [ucs]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
980 浏览

algorithm - What's the difference between Modified Dijkstra with single source, single destination point and Uniform Cost Search?

If we modify Dijkstra algorithm from "single source to all nodes shortest path" to find the shortest path from "single source to a single destination point", then what will be the difference between this modified Dijkstra and uniform cost search? Any help will be appreciated. Thanks.

0 投票
0 回答
110 浏览

python - 在具有 Python UCS4 的 Ubuntu 14.04 中创建 Virtualenv

我需要在 Ubuntu 上使用具有 UCS4 编码的 Python 2.7.14 创建一个虚拟环境。似乎默认情况下我得到一个 UCS2。是否有一个标志可以传递给 virtualenv 命令以设置正确的编码,或者它可能是我应该在第二步中更改的设置?

0 投票
2 回答
122 浏览

unicode - 如何确定 UTF-16 字符的字节宽度?

读取 UTF-16 字节流以确定一个字符占用多少字节的规则是什么?我已经阅读了这些标准,但是根据对现实世界 UTF-16 编码流的经验观察,似乎有些地方标准不适用(或者我缺少标准的某个方面) .

从阅读 UTF-16 标准https://www.rfc-editor.org/rfc/rfc2781

前 2 个字节的值 结果字符长度(字节)
0x0000-0xC7FF 2
0xD800-0xDBFF 4
0xDC00-0xDFFF 无效序列 (RFC2781 2.2.2)
0xDFFF-0xFFFF 4

在实践中,这似乎是正确的,至少在某些情况下是这样。使用临时 SQL 脚本(SQL Server 2019;UTF-16 排序规则),但也使用在线解码器进行了验证:

特点 统一码名称 ISO 10646 UTF-16 编码(十六进制,大端) 大小(字节)
一个 拉丁文大写字母 A U+0041 00 41 2
Б 西里尔大写字母 BE U+0411 04 11 2
ァ</td> 片假名字母小 A U+30A1 30 A1 2
兔脸 U+1F430 D8 3D DC 30 4

但是,当将以下 ISO 10646 字符编码为 UTF-16 时,它似乎是 4 个字节,但读取前 2 个字节似乎并没有表明它会这么长:

特点 统一码名称 UTF-16 编码(十六进制,大端) 大小(字节)
⚕️ 埃斯库拉皮乌斯的工作人员 26 95 FE 0F 4

虽然我宁愿让我的问题与软件无关;以下 SQL 将使用默认排序规则和默认语言在 Microsoft SQL Server 2019 上重现此行为。(注意 SQL Server 是小端的)。

很简单,您如何/为什么阅读0x2695并认为“我需要阅读这个角色的下一个单词。”?为什么这似乎与已发布的 UTF-16 标准不一致?

0 投票
0 回答
17 浏览

python - AttributeError:“节点”对象没有属性“is_goal”UCS Python