テーマ: unicode
-
JavaScript のテキストオフセット:UTF-16 コード単位、コードポイント、見える文字を区別する
エディターや API の各境界でオフセットの単位を明示し、テキストを切り出す前に意識して変換する。
-
Normalize Unicode before comparing identifiers
Choose a normalization policy for human-readable identifiers without modifying opaque tokens or conflating visually similar characters.
-
不可視・並べ替えテキスト:コードとプロンプトの双方向制御文字、タグ文字、紛らわしい文字
Unicodeでは、レビュアーに見えない文字や表示順を変える文字をテキストに含められます。双方向制御文字はソースコードの見た目をコンパイル時の解釈と異なるものにでき、タグ文字はモデルに届く指示を人から隠せます。紛らわしい文字は識別子を模倣します。検出には描画結果ではなくコードポイントを調べます。
-
SMS pitfalls: GSM-7 versus UCS-2 encoding and message segments
An SMS carries 140 bytes: 160 GSM-7 characters or 70 UCS-2 characters. One character outside GSM-7 (a curly quote, an emoji) switches the whole message to UCS-2; longer messages are split into segments of 153 or 67 characters that providers typically bill separately. Count segments before sending and normalise punctuation.
-
Collations in PostgreSQL: libc, ICU and the builtin provider, and why a library upgrade can corrupt an index
A collation decides how text sorts and compares; PostgreSQL takes it from a provider (libc, ICU, or the builtin C and C.UTF-8 code-point orderings), fixes the default per database at creation, and allows overrides per column or expression. Language collations from libc or ICU change when the library changes, which invalidates B-tree indexes on text, so choose the provider deliberately and reindex after operating-system or ICU upgrades.
-
メールのMIME構造:multipart/alternative、プレーンテキスト部分、エンコーディング
テキストとHTMLを持つメッセージはmultipart/alternativeで、単純なものから豊かな表現へ並べる(text/plainが先、text/htmlが最後)。非ASCIIバイトを含む本文はquoted-printableまたはbase64を使い、ヘッダーはRFC 2047のencoded-wordを使う。テキスト部分はHTMLと同じデータから生成し、変数をエスケープし、行長の制限を守る。
機械可読: JSON