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がもし先頭以外に現れたら読み飛ばす?
2023/03/05(日) 16:31:35.44ID:C3C6IsZE
>>13
ここで言われるASCII互換は、ASCII上位互換だな。
今までと同じ入力(ASCII)には同じ出力になることが期待されている。今まで勝手にBOMを付けなかったので、勝手にBOMつけるのはNGくらいの意味。
ここで言われるASCII互換は、ASCII上位互換だな。
今までと同じ入力(ASCII)には同じ出力になることが期待されている。今まで勝手にBOMを付けなかったので、勝手にBOMつけるのはNGくらいの意味。
■ このスレッドは過去ログ倉庫に格納されています
ニュース
- 米大統領報道官「日本と強固な同盟維持、中国とも協力」 [少考さん★]
- ミス・ユニバース フィンランド代表の「つり目」写真が波紋… 本人釈明も批判やまず 協会謝罪「徹底的に検証」へ [冬月記者★]
- 【おこめ券】鈴木憲和農相 小泉前農相の備蓄米放出を“反省”「備蓄の円滑な運営を図ってまいります」 [Hitzeschleier★]
- 1人3千円の食品高騰対策、何に使える? あいまいなまま衆院通過 [蚤の市★]
- ゆたぼん 二重手術を報告「めちゃくちゃ気に入っています」 [muffin★]
- 【山形】クマ駆除で誤射した猟友会隊員に町が1663万円請求へ...弾当たり男性大けが2023年 小国町 [nita★]
- 【マギレコ】VIPでマギアレコード&マギアエクセドラ【まどドラ】
- 中国人、ガチ超正論。「日本人がアイヌに対してやったことを『問題ない』とするなら、中国が日本人に同じことをしても文句ないだろう?」 [314039747]
- 【悲報】新米、全く売れなくて倉庫が満杯になってしまうwwwwwwwwwwwwwwwwwwww [802034645]
- 【高市悲報】ウクライナ、ガチで敗北か?東部の帰属国民投票にかける可能性-ゼレンスキー [888298477]
- 洗車ってどれぐらいの間隔でやってる?
- 木曜日のんなっしょい❗(・o・🍬)仕放題スレ🏡
