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.
■ このスレッドは過去ログ倉庫に格納されています
ニュース
- 国民 居住目的でない住宅所有者に「空室税」課せる法案を提出 [少考さん★]
- 「働いて働いて」の流行語大賞に懸念 「言葉が独り歩き」 過労自殺遺族 [尺アジ★]
- アメリカ、入国時に「日本人を含む外国人観光客の最大5年分のSNS履歴の提出」義務化へ 過去10年間に使用のメールアドレスや電話番号等も★3 [Hitzeschleier★]
- 【画像】消えた美人女優 上原多香子さん(42)、沖縄で目撃される [牛丼★]
- 「暖房が使えない」「食費が高くて子どもの栄養が…」 物価高に苦しむ子育て世帯、政府に期待する支援は ★2 [蚤の市★]
- バイク事故で入院ゆたぼん、見舞金「1円」振り込みの名義に衝撃「悲しい人ですね」「こういう人がいるから…」 [muffin★]
- 【実況】博衣こよりのえちえちダンガンロンパ2🧪★1
- 【高市朗報】中国、歴史上日本に一度も侵攻したことがない親日国だった [931948549]
- 高市早苗、森元総理の愛人だった [347751896]
- 【声優】亡くなった人で好きだった声優👈誰を思いつく?? [519998392] [839143615]
- 嫁「ナプキン買ってきて」俺「はい」
- 来年からPCの価格がガチのマジで超ヤバイ程値上がる模様。お前ら買ったか?Sandy高市 [484676894]
