Repository navigation
Foundation: 文字コード変換 libcode を追加 - #161
Merged
Merged
Conversation
UTF-32BE を基準に、UTF-8(BOM あり/なし)、UTF-16LE/BE、UTF-32LE との cpt_code_<enc>_to_utf32be / cpt_code_utf32be_to_<enc> を /lib/code.1.wal として提供する。 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FFAstnZtE3BzBcmKEHnjaW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by src3453 · project thread
Closes #160
概要
/lib/code.1.wal(libcode、image IDcode1.0)を追加。UTF-8(BOM あり/なし)、UTF-16LE/BE、UTF-32LE/BE の相互変換を、UTF-32BE を基準にしたcpt_code_<enc>_to_utf32be/cpt_code_utf32be_to_<enc>で提供します。他の符号化どうしは UTF-32BE を経由します。*dst_sizeは conde と同じ。不正入力は既定でCONDE_DATA/CONDE_INPUT_EOF、CODE_REPLACEで U+FFFD(maximal subpart)。utf8bomは出力で必ず付与・入力で読み飛ばし。他はCODE_ADD_BOM/CODE_STRIP_BOM。cpt_code_detectで BOM から判別。cpt_code_boundで出力サイズの上限を見積もり。boot/build.pyで既定ディスクに配置。README とmemory/を更新。検証
CLANG=clang-20 python3 -m unittest foundation.tests.code.test_code(ホスト: Python codecs と照合、Foundation 上: -O1/-O2 × scalar/pipeline)通過python foundation/run.py --build-onlyで/lib/code.1.walが入ることを確認(tests/disk自体は未実行)Generated by Claude Code