@prefix schema: <https://schema.org/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ks: <https://comcomponent.com/vocab/> .

<https://comcomponent.com/blog/2026/03/19/002-codex-windows-mojibake-prompting-best-practices/#article>
    schema:about <https://comcomponent.com/knowledge/codex/>, <https://comcomponent.com/knowledge/mojibake/>, <https://comcomponent.com/knowledge/agents-md/> ;
    schema:mentions <https://comcomponent.com/knowledge/cp932/>, <https://comcomponent.com/knowledge/utf-8/>, <https://comcomponent.com/knowledge/utf-16/>, <https://comcomponent.com/knowledge/bom/>, <https://comcomponent.com/knowledge/ansi-codepage/>, <https://comcomponent.com/knowledge/replacement-character/>, <https://comcomponent.com/knowledge/unverified-save/>, <https://comcomponent.com/knowledge/reencoding-corruption/>, <https://comcomponent.com/knowledge/pre-read-encoding-check/>, <https://comcomponent.com/knowledge/post-write-reread-verification/>, <https://comcomponent.com/knowledge/ambiguous-write-path/>, <https://comcomponent.com/knowledge/explicit-encoding-write/>, <https://comcomponent.com/knowledge/windows-powershell-5-1/>, <https://comcomponent.com/knowledge/powershell-7/>, <https://comcomponent.com/knowledge/existing-file-encoding-preservation/>, <https://comcomponent.com/knowledge/utf8-migration-as-separate-task/>, <https://comcomponent.com/knowledge/strict-utf8-decode-check/>, <https://comcomponent.com/knowledge/encoding-misinterpretation/>, <https://comcomponent.com/knowledge/character-encoding-rules/> .

<https://comcomponent.com/knowledge/codex/> a skos:Concept ;
    skos:prefLabel "Codex"@ja ;
    skos:definition "OpenAIが提供する、リポジトリのファイルを実際に読み書きするコーディングエージェント。"@ja ;
    skos:altLabel "OpenAI Codex" .

<https://comcomponent.com/knowledge/mojibake/> a skos:Concept ;
    skos:prefLabel "文字化け"@ja ;
    skos:definition "実際のバイト列の解釈が意図したencodingとずれ、表示や内容が壊れて見える状態。"@ja .

<https://comcomponent.com/knowledge/agents-md/> a skos:Concept ;
    skos:prefLabel "AGENTS.md"@ja ;
    skos:definition "リポジトリでの作業に対する常設の指示を書いておくMarkdownファイルで、ルートから作業ディレクトリへ向かって連結され、既定で合計32KiB程度で打ち切られる。"@ja .

<https://comcomponent.com/knowledge/character-encoding-rules/> a skos:Concept ;
    skos:prefLabel "文字コードの作業ルール"@ja ;
    skos:definition "既存ファイルを読む前の確認、推測のままの保存禁止、既存encodingの維持、encoding明示書き込み、保存後の再読込検証などをまとめた、Codexに与える作業手順の集合。"@ja ;
    ks:configuredBy <https://comcomponent.com/knowledge/agents-md/> ;
    ks:recommendedFor <https://comcomponent.com/knowledge/codex/> .

<https://comcomponent.com/knowledge/pre-read-encoding-check/> a skos:Concept ;
    skos:prefLabel "読む前のencoding/BOM/改行確認"@ja ;
    skos:definition "日本語を含む既存ファイルを読む前に、encoding候補・BOMの有無・改行コードを確認する作業手順。"@ja ;
    ks:recommendedFor <https://comcomponent.com/knowledge/codex/> ;
    ks:verifiedBy <https://comcomponent.com/knowledge/bom/> ;
    ks:verifiedBy <https://comcomponent.com/knowledge/strict-utf8-decode-check/> ;
    ks:mitigates <https://comcomponent.com/knowledge/encoding-misinterpretation/> .

<https://comcomponent.com/knowledge/unverified-save/> a skos:Concept ;
    skos:prefLabel "推測のままの保存"@ja ;
    skos:definition "文字化けが疑わしいファイルについて、encoding解釈に自信が持てないまま上書き保存すること。"@ja ;
    ks:notRecommendedFor <https://comcomponent.com/knowledge/codex/> .

<https://comcomponent.com/knowledge/existing-file-encoding-preservation/> a skos:Concept ;
    skos:prefLabel "既存ファイルのencoding維持方針"@ja ;
    skos:definition "既存ファイルを編集するときは元のencoding・BOM・改行コードを維持し、新規ファイルだけrepo規約に沿ったUTF-8系で作成する運用方針。"@ja ;
    ks:recommendedFor <https://comcomponent.com/knowledge/codex/> .

<https://comcomponent.com/knowledge/explicit-encoding-write/> a skos:Concept ;
    skos:prefLabel "encodingを明示する書き込み"@ja ;
    skos:definition "Set-Content -Encodingなど、書き込み時に使用するencodingを明示的に指定する方法。"@ja ;
    ks:recommendedFor <https://comcomponent.com/knowledge/codex/> .

<https://comcomponent.com/knowledge/post-write-reread-verification/> a skos:Concept ;
    skos:prefLabel "保存後の再読込検証"@ja ;
    skos:definition "保存後にファイルを再読込し、日本語の代表行が壊れていないか、置換文字や`?`が増えていないかなどを確認する作業手順。"@ja ;
    ks:recommendedFor <https://comcomponent.com/knowledge/codex/> .

<https://comcomponent.com/knowledge/ambiguous-write-path/> a skos:Concept ;
    skos:prefLabel "曖昧な書き込み経路"@ja ;
    skos:definition "リダイレクトやOut-Fileなど、encodingを明示しないままファイルへ書き込む経路。"@ja ;
    skos:altLabel "encoding非明示の書き込み"@ja ;
    ks:notRecommendedFor <https://comcomponent.com/knowledge/codex/> ;
    ks:uses <https://comcomponent.com/knowledge/windows-powershell-5-1/> ;
    ks:uses <https://comcomponent.com/knowledge/powershell-7/> .

<https://comcomponent.com/knowledge/utf8-migration-as-separate-task/> a skos:Concept ;
    skos:prefLabel "UTF-8化の別タスク化"@ja ;
    skos:definition "リポジトリ全体をUTF-8へ統一する変換は、通常の機能修正とは分離し、差分と影響範囲を見ながら進める独立したタスクとして扱う方針。"@ja ;
    ks:recommendedFor <https://comcomponent.com/knowledge/codex/> .

<https://comcomponent.com/knowledge/cp932/> a skos:Concept ;
    skos:prefLabel "CP932"@ja ;
    skos:definition "Windowsの日本語コードページ(コードページ番号932)。実務上はWindows版のShift_JISに近いが、他システムのShift_JIS実装と1バイトも違わない保証はない。"@ja ;
    skos:altLabel "Windows-31J" ;
    skos:altLabel "Windowsの日本語コードページ"@ja .

<https://comcomponent.com/knowledge/utf-8/> a skos:Concept ;
    skos:prefLabel "UTF-8"@ja ;
    skos:definition "Unicodeの可変長エンコーディング方式。バイト列に強い制約があるため、CP932など他のエンコーディングのバイト列は厳密デコードで失敗しやすい。"@ja .

<https://comcomponent.com/knowledge/bom/> a skos:Concept ;
    skos:prefLabel "BOM(Byte Order Mark)"@ja ;
    skos:definition "ファイル先頭に置かれ、どのUnicodeエンコーディングかを示す数バイトの目印。UTF-8はEF BB BF、UTF-16 LEはFF FE、UTF-16 BEはFE FF。"@ja ;
    skos:altLabel "バイトオーダーマーク"@ja .

<https://comcomponent.com/knowledge/strict-utf8-decode-check/> a skos:Concept ;
    skos:prefLabel "厳密UTF-8デコード判定"@ja ;
    skos:definition "不正なバイト列があれば例外を投げる設定でUTF-8としてデコードを試み、成功するかどうかでCP932など他候補との切り分けに使う判定方法。"@ja .

<https://comcomponent.com/knowledge/encoding-misinterpretation/> a skos:Concept ;
    skos:prefLabel "encoding解釈のずれ"@ja ;
    skos:definition "見た目は読めているように見えるが、実際のバイト列の解釈がファイルの本来のencodingとずれている状態。"@ja ;
    ks:mayCause <https://comcomponent.com/knowledge/mojibake/> .

<https://comcomponent.com/knowledge/reencoding-corruption/> a skos:Concept ;
    skos:prefLabel "誤ったencoding解釈によるファイル破損"@ja ;
    skos:definition "読めていない文字列を読めているものとして扱ったまま保存した結果、表示上の問題ではなくファイル自体の破損として固定される状態。"@ja ;
    skos:altLabel "再エンコード事故"@ja ;
    ks:verifiedBy <https://comcomponent.com/knowledge/replacement-character/> .

<https://comcomponent.com/knowledge/replacement-character/> a skos:Concept ;
    skos:prefLabel "U+FFFD(REPLACEMENT CHARACTER)"@ja ;
    skos:definition "デコードに失敗したバイトの置き換え先として入る文字。多くの環境で「◆の中に?」の形に表示され、増加は情報が失われたことを示す。"@ja ;
    skos:altLabel "置換文字"@ja .

<https://comcomponent.com/knowledge/windows-powershell-5-1/> a skos:Concept ;
    skos:prefLabel "Windows PowerShell 5.1"@ja ;
    skos:definition "Windowsに標準で同梱されている、.NET Framework上に構築されたレガシー世代のPowerShell(5.1系)のランタイム。実行ファイルはpowershell.exeで、.NETアプリからはMicrosoft.PowerShell.5.1.ReferenceAssembliesを介して呼び出せる。"@ja ;
    skos:altLabel "Microsoft.PowerShell.5.1.ReferenceAssemblies" ;
    ks:uses <https://comcomponent.com/knowledge/ansi-codepage/> ;
    ks:uses <https://comcomponent.com/knowledge/utf-16/> .

<https://comcomponent.com/knowledge/ansi-codepage/> a skos:Concept ;
    skos:prefLabel "ANSIコードページ"@ja ;
    skos:definition "OSのロケールに対応した既定のレガシーコードページ。日本語Windowsでは932(CP932)になる。"@ja .

<https://comcomponent.com/knowledge/utf-16/> a skos:Concept ;
    skos:prefLabel "UTF-16"@ja ;
    skos:definition "先頭のBOM(LEならFF FE、BEならFE FF)で種別を見分けられる、Unicodeのエンコーディング方式。"@ja ;
    skos:altLabel "UTF-16LE" ;
    skos:altLabel "UTF-16BE" .

<https://comcomponent.com/knowledge/powershell-7/> a skos:Concept ;
    skos:prefLabel "PowerShell 7"@ja ;
    skos:definition "PowerShell Core系譜の最新世代で、.NET(Core以降)上に構築されたPowerShellのエディション。実行ファイルはpwsh.exeで5.1のpowershell.exeとサイドバイサイドに共存し、Out-File・Set-Content・Export-Csvなどの既定書き込みencodingはBOMなしUTF-8である。"@ja ;
    ks:uses <https://comcomponent.com/knowledge/utf-8/> .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/character-encoding-rules/> ;
    rdf:predicate ks:configuredBy ;
    rdf:object <https://comcomponent.com/knowledge/agents-md/> ;
    schema:description "文字コードに関する作業ルールは、毎回のタスクで繰り返すよりAGENTS.mdへ常設したほうが安定する。"@ja ;
    ks:evidence <https://developers.openai.com/codex/guides/agents-md/> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/character-encoding-rules/> ;
    rdf:predicate ks:recommendedFor ;
    rdf:object <https://comcomponent.com/knowledge/codex/> ;
    schema:description "Windowsで日本語ファイルを扱わせるCodexに、最初に与えると効きやすい作業ルールである。"@ja ;
    ks:evidence <https://developers.openai.com/codex/learn/best-practices/> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/pre-read-encoding-check/> ;
    rdf:predicate ks:recommendedFor ;
    rdf:object <https://comcomponent.com/knowledge/codex/> ;
    schema:description "日本語を含む既存ファイルは、読む前にencoding候補・BOM有無・改行コードを確認させることが推奨される。"@ja ;
    ks:evidence <https://developers.openai.com/codex/learn/best-practices/> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/unverified-save/> ;
    rdf:predicate ks:notRecommendedFor ;
    rdf:object <https://comcomponent.com/knowledge/codex/> ;
    schema:description "文字化けが疑わしいファイルを、encoding解釈に自信が持てないまま保存させることは推奨されない。"@ja ;
    ks:evidence <https://developers.openai.com/codex/learn/best-practices/> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/existing-file-encoding-preservation/> ;
    rdf:predicate ks:recommendedFor ;
    rdf:object <https://comcomponent.com/knowledge/codex/> ;
    schema:description "既存ファイルの編集では元のencoding・BOM・改行を維持させ、新規ファイルだけUTF-8系にすることが推奨される。"@ja ;
    ks:evidence <https://developers.openai.com/codex/learn/best-practices/> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/explicit-encoding-write/> ;
    rdf:predicate ks:recommendedFor ;
    rdf:object <https://comcomponent.com/knowledge/codex/> ;
    schema:description "書き込みはencodingを明示できる方法だけを使わせることが推奨される。"@ja ;
    ks:evidence <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/post-write-reread-verification/> ;
    rdf:predicate ks:recommendedFor ;
    rdf:object <https://comcomponent.com/knowledge/codex/> ;
    schema:description "保存後は再読込して日本語の代表行を検証させることが推奨される。"@ja ;
    ks:evidence <https://developers.openai.com/codex/learn/best-practices/> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/ambiguous-write-path/> ;
    rdf:predicate ks:notRecommendedFor ;
    rdf:object <https://comcomponent.com/knowledge/codex/> ;
    schema:description "リダイレクトや便利コマンドなど、encodingを明示しない書き込み経路をデフォルトで使わせることは推奨されない。"@ja ;
    ks:evidence <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/utf8-migration-as-separate-task/> ;
    rdf:predicate ks:recommendedFor ;
    rdf:object <https://comcomponent.com/knowledge/codex/> ;
    schema:description "リポジトリ全体をUTF-8へ統一する作業は、日常の改修とは切り離した別タスクとして進めることが推奨される。"@ja ;
    ks:evidence <https://developers.openai.com/codex/learn/best-practices/> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/cp932/> ;
    rdf:predicate ks:incompatibleWith ;
    rdf:object <https://comcomponent.com/knowledge/utf-8/> ;
    schema:description "非ASCIIのバイトを含む場合、CP932のバイト列をUTF-8として厳密にデコードすると多くの場合失敗するため、同じバイト列を両方の解釈で同時に正しく読むことはできない。ASCIIの範囲だけで書かれたファイルは両方の解釈で同一に読める"@ja ;
    ks:evidence <https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "context-dependent" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/pre-read-encoding-check/> ;
    rdf:predicate ks:verifiedBy ;
    rdf:object <https://comcomponent.com/knowledge/bom/> ;
    schema:description "ファイル先頭がEF BB BF/FF FE/FE FFであれば、それだけでUTF-8/UTF-16 LE/UTF-16 BEと確定できる。"@ja ;
    ks:evidence <https://learn.microsoft.com/en-us/globalization/encoding/byte-order-mark> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/pre-read-encoding-check/> ;
    rdf:predicate ks:verifiedBy ;
    rdf:object <https://comcomponent.com/knowledge/strict-utf8-decode-check/> ;
    schema:description "BOMがない場合は、UTF-8として厳密にデコードできるかどうかがCP932などとの切り分けに使える最有力の手がかりになる。"@ja ;
    ks:evidence <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/encoding-misinterpretation/> ;
    rdf:predicate ks:mayCause ;
    rdf:object <https://comcomponent.com/knowledge/mojibake/> ;
    schema:description "実際のバイト列の解釈が本来のencodingとずれると、表示や内容が壊れて見える文字化けが起きる。"@ja ;
    ks:evidence <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/mojibake/> ;
    rdf:predicate ks:mayCause ;
    rdf:object <https://comcomponent.com/knowledge/reencoding-corruption/> ;
    schema:description "文字化けに気づかないまま保存すると、表示上の問題ではなくファイル自体の破損として固定される。"@ja ;
    ks:evidence <https://developers.openai.com/codex/learn/best-practices/> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "context-dependent" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/unverified-save/> ;
    rdf:predicate ks:mayCause ;
    rdf:object <https://comcomponent.com/knowledge/reencoding-corruption/> ;
    schema:description "encoding解釈に自信が持てないまま保存すると、誤った解釈がそのままファイルの破損として固定され得る。"@ja ;
    ks:evidence <https://developers.openai.com/codex/learn/best-practices/> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "context-dependent" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/pre-read-encoding-check/> ;
    rdf:predicate ks:mitigates ;
    rdf:object <https://comcomponent.com/knowledge/encoding-misinterpretation/> ;
    schema:description "読む前にencoding候補・BOM・改行を確認させることで、実バイト列の解釈が本来のencodingとずれるリスクを減らせる。"@ja ;
    ks:evidence <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/reencoding-corruption/> ;
    rdf:predicate ks:verifiedBy ;
    rdf:object <https://comcomponent.com/knowledge/replacement-character/> ;
    schema:description "保存後の再読込で置換文字U+FFFDや`?`の増加が見えたら、encoding解釈が壊れていたことを確認できる。"@ja ;
    ks:evidence <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/windows-powershell-5-1/> ;
    rdf:predicate ks:uses ;
    rdf:object <https://comcomponent.com/knowledge/ansi-codepage/> ;
    schema:description "Windows PowerShell 5.1でSet-Content/Add-Contentが新規ファイルに書き込むときの既定encodingは、システムのANSIコードページである。"@ja ;
    ks:evidence <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/windows-powershell-5-1/> ;
    rdf:predicate ks:uses ;
    rdf:object <https://comcomponent.com/knowledge/utf-16/> ;
    schema:description "Windows PowerShell 5.1でOut-Fileやリダイレクト(>、>>)を使ったときの既定書き込みencodingはUTF-16LEである。"@ja ;
    ks:evidence <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/powershell-7/> ;
    rdf:predicate ks:uses ;
    rdf:object <https://comcomponent.com/knowledge/utf-8/> ;
    schema:description "PowerShell 7でOut-File、Set-Content、Export-Csvを使ったときの既定書き込みencodingはBOMなしUTF-8である。"@ja ;
    ks:evidence <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/ambiguous-write-path/> ;
    rdf:predicate ks:uses ;
    rdf:object <https://comcomponent.com/knowledge/windows-powershell-5-1/> ;
    schema:description "曖昧な書き込み経路の既定encodingは、Windows PowerShell 5.1ではUTF-16LEやANSIコードページになる。"@ja ;
    ks:evidence <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .

[] a rdf:Statement ;
    rdf:subject <https://comcomponent.com/knowledge/ambiguous-write-path/> ;
    rdf:predicate ks:uses ;
    rdf:object <https://comcomponent.com/knowledge/powershell-7/> ;
    schema:description "曖昧な書き込み経路の既定encodingは、PowerShell 7ではBOMなしUTF-8になる。"@ja ;
    ks:evidence <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding> ;
    ks:verifiedAt "2026-08-01" ;
    ks:certainty "established" .
