Move the official stdlib text modules to their unique source authority and freeze the bundle-root paths (std:text, std:text/utf8). text.utf8编码 becomes a thin wrapper over the single UTF-8 implementation in text/utf8.mq.md. Carry the pre-migration product assertions into component-owned cases with the baseline observation terminal values, plus an explicit-input test entry point (MARQDO_BIN + MARQDO_STDLIB_DIR). No parser, host or CLI change. Refs cflmy/marqdo#9, cflmy/marqdo-std-text#1
15 lines
224 B
Markdown
15 lines
224 B
Markdown
---
|
|
import:
|
|
utf8: "std:text/utf8"
|
|
---
|
|
|
|
# @exec utf8
|
|
|
|
## main
|
|
|
|
**内存 = memory.new(1, 1)**
|
|
|
|
**长度 = utf8.编码("é", 内存, 0)**
|
|
|
|
`return [长度, utf8.解码(内存, 0, 长度).value, utf8.解码(内存, 0, 1).ok]`
|