Windows NTは初代からUnicodeがネイティブの文字コードです。cp932ではありません。
プログラマーなら一度は煩わされたことのある文字コードについてのスレ。
UTF-8、Shift_JIS、JIS、EUC、Unicode、UCS、サロゲートペア、コードポイント、文字コード判定、
合成文字、ソート、TRON、外字コード、その他について語り合いましょう。
各言語での文字列の扱いについての質問もOKです。
基本マッターリ、ささ、茶でもどうぞ。
■過去スレ
文字コード総合スレ part1 http://pc11.2ch.net/test/read.cgi/tech/1031028205/
文字コード総合スレ part2 http://pc11.2ch.net/test/read.cgi/tech/1143375639/
文字コード総合スレ part3 http://pc11.2ch.net/test/read.cgi/tech/1180250376/
文字コード総合スレ part4 http://pc11.2ch.net/test/read.cgi/tech/1228052369/
(スレ再利用)UnicodeとUTF-8の違いは? http://pc12.2ch.net/test/read.cgi/tech/1177930957/
(隔離スレ)UnicodeとUTF-8の違いは? その2 http://pc12.2ch.net/test/read.cgi/tech/1274937437/
文字コード総合スレ part5 http://pc12.2ch.net/test/read.cgi/tech/1236529563/
文字コード総合スレ part6 http://hibari.2ch.net/test/read.cgi/tech/1278923059/
文字コード総合スレ part7 http://toro.2ch.net/test/read.cgi/tech/1306595564/
文字コード総合スレ part8 http://peace.2ch.net/test/read.cgi/tech/1354248962/
文字コード総合スレ part9 http://peace.2ch.net/test/read.cgi/tech/1401301779/
文字コード総合スレ Part10 http://mevius.2ch.net/test/read.cgi/tech/1444822140/
文字コード総合スレ Part11 https://mevius.5ch.net/test/read.cgi/tech/1516629503/
文字コード総合スレ Part12 https://mevius.5ch.net/test/read.cgi/tech/1544931495/
文字コード総合スレ part13
https://mevius.5ch.net/test/read.cgi/tech/1593777227/
探検
文字コード総合スレ part14
■ このスレッドは過去ログ倉庫に格納されています
2023/03/03(金) 15:46:58.08ID:yKqwMGHT
2023/03/03(金) 18:50:36.86ID:GXuOSZhF
乙
2023/03/04(土) 05:49:15.61ID:USGrlhof
Q. UTF-8 に BOM をつけるべきですか?
A. Unocode Standard では「付けたければ付けても良いが、付ける必要はないし、付けるのはお勧めしない」と規定されています。
A. Unocode Standard では「付けたければ付けても良いが、付ける必要はないし、付けるのはお勧めしない」と規定されています。
2023/03/04(土) 11:03:14.60ID:RFNVa0Qi
>>1
>Windows NTは初代からUnicodeがネイティブの文字コードです。cp932ではありません。
filesystem の文字コードと system locale についても詳しく
あとファイル名に BOM 必要かどうかも
>Windows NTは初代からUnicodeがネイティブの文字コードです。cp932ではありません。
filesystem の文字コードと system locale についても詳しく
あとファイル名に BOM 必要かどうかも
2023/03/04(土) 11:35:06.58ID:vwOVzejx
>>3
訳し方でニュアンスが変わるから根拠となる規格の原文も載せた方が良いぞ
訳し方でニュアンスが変わるから根拠となる規格の原文も載せた方が良いぞ
2023/03/04(土) 20:52:22.05ID:Uzl83FOV
UTF-8, UTF-16, UTF-32 & BOM
https://unicode.org/faq/utf_bom.html
「付けたければ付けても良いが、付ける必要はないし、付けるのはお勧めしない」なんてどこにも書いてないんだが
https://unicode.org/faq/utf_bom.html
「付けたければ付けても良いが、付ける必要はないし、付けるのはお勧めしない」なんてどこにも書いてないんだが
2023/03/04(土) 23:54:57.70ID:q+Tu7Jlx
2023/03/05(日) 00:42:43.70ID:lXlBYG2e
>>3
何で規定されてんの?
何で規定されてんの?
2023/03/05(日) 01:11:17.97ID:JF7lH/t4
>>6
Unicode Standard を嫁。
Unicode Standard を嫁。
2023/03/05(日) 01:17:14.07ID:JF7lH/t4
>>8
規格に理由は書かれてない。
規格書では趣旨として UTF-8 では Unicode をASCII互換にするための方式みたいな説明してるので、BOM をつけると ASCII互換性が崩れるのが駄目なのかもしれない。違うかもしれない。
規格に理由は書かれてない。
規格書では趣旨として UTF-8 では Unicode をASCII互換にするための方式みたいな説明してるので、BOM をつけると ASCII互換性が崩れるのが駄目なのかもしれない。違うかもしれない。
2023/03/05(日) 10:21:41.04ID:uw77rwIl
すまそ。ここの40ページにUTF-8でBOMが許可されるって書いてあった
https://www.unicode.org/versions/Unicode15.0.0/UnicodeStandard-15.0.pdf
Table 2-4. The Seven Unicode Encoding Schemes
Encoding Scheme: UTF-8
Endian Order: N/A
BOM Allowed?: yes
https://www.unicode.org/versions/Unicode15.0.0/UnicodeStandard-15.0.pdf
Table 2-4. The Seven Unicode Encoding Schemes
Encoding Scheme: UTF-8
Endian Order: N/A
BOM Allowed?: yes
2023/03/05(日) 10:24:42.19ID:Dqp2Pk7H
The Unicode® Standard Version 15.0 – Core Specification
https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf
When converting between different encoding schemes, extreme care must be taken in handling any initial byte order marks.
For example, if one converted a UTF-16 byte serialization with an initial byte order mark to a UTF-8 byte serialization, thereby converting the byte order mark to <EF BB BF> in the UTF-8 form, the <EF BB BF> would now be ambiguous as to its status as a byte order mark (from its source) or as an initial zero width no break space.
If the UTF-8 byte serialization were then converted to UTF-16BE and the initial <EF BB BF> were converted to <FE FF>, the interpretation of the U+FEFF character would have been modified by the conversion.
This would be nonconformant behavior according to conformance clause C7, because the change between byte serializations would have resulted in modification of the interpretation of the text.
This is one reason why the use of the initial byte sequence <EF BB BF> as a signature on UTF-8 byte sequences is not recommended by the Unicode Standard.
https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf
When converting between different encoding schemes, extreme care must be taken in handling any initial byte order marks.
For example, if one converted a UTF-16 byte serialization with an initial byte order mark to a UTF-8 byte serialization, thereby converting the byte order mark to <EF BB BF> in the UTF-8 form, the <EF BB BF> would now be ambiguous as to its status as a byte order mark (from its source) or as an initial zero width no break space.
If the UTF-8 byte serialization were then converted to UTF-16BE and the initial <EF BB BF> were converted to <FE FF>, the interpretation of the U+FEFF character would have been modified by the conversion.
This would be nonconformant behavior according to conformance clause C7, because the change between byte serializations would have resulted in modification of the interpretation of the text.
This is one reason why the use of the initial byte sequence <EF BB BF> as a signature on UTF-8 byte sequences is not recommended by the Unicode Standard.
2023/03/05(日) 10:24:58.61ID:dEWQ/p/B
2023/03/05(日) 11:15:20.72ID:V5cM5Nk9
一般に言うASCII互換ってそういう意味じゃねえだろ。
2023/03/05(日) 12:40:57.35ID:/Qd0pRlS
BOMがもし先頭以外に現れたら読み飛ばす?
■ このスレッドは過去ログ倉庫に格納されています
ニュース
- 中国、日本行き“50万人”キャンセル 渡航自粛でコロナ禍以来最大 ★2 [お断り★]
- 高市首相答弁を“引き出した”立民・岡田克也氏が改めて説明「なぜ慎重な答弁をされなかったのか。非常に残念に思っている」 ★6 [ぐれ★]
- 中国外務省局長 「ポケットに手を入れていたのは寒いから」 日本との局長級会談で [お断り★]
- 中国、日本行き“50万人”キャンセル 渡航自粛でコロナ禍以来最大 ★3 [お断り★]
- 【速報】中国外務省報道官 高市首相発言撤回なければ「断固たる対抗措置」 ★3 [蚤の市★]
- 【次の一手】台湾問題で小林よしのり氏が私見「まさに戦争前夜」「ただちに徴兵制を敷いて、高市支持者を最前線へ」… ★4 [BFU★]
- 【実況】博衣こよりのえちえちフログロ学力テスト🧪★2
- 【実況】博衣こよりのえちえちフログロ学力テスト🧪
- 【傾国の美女】高市早苗さん、地元奈良の柿を頬張りラップを披露「未来を拓く、ちから湧く」 [522666295]
- 【高市早苗】習近平、本気で激おこ [115996789]
- 【ぺこ専🐰】なんG 兎田ぺこら実況スレ🏡【ホロライブ▶】
- 【悲報】高市早苗さん、もう辞職しか選択肢がない… [271912485]
