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.
■ このスレッドは過去ログ倉庫に格納されています
ニュース
- 国民 居住目的でない住宅所有者に「空室税」課せる法案を提出 ★2 [少考さん★]
- 「働いて働いて」の流行語大賞に懸念 「言葉が独り歩き」 過労自殺遺族 [尺アジ★]
- アメリカ、入国時に「日本人を含む外国人観光客の最大5年分のSNS履歴の提出」義務化へ 過去10年間に使用のメールアドレスや電話番号等も★3 [Hitzeschleier★]
- 【音楽】aiko(50)の姿に騒然「どしたん?」「震えた」「泣いた」「びっくりする」「なんで…」結婚発表から4年 [Ailuropoda melanoleuca★]
- 【EV新税】最大2万4千円で検討 28年から、普及妨げると異論も [蚤の市★]
- 【山形】クマ駆除で誤射した猟友会隊員に町が1663万円請求へ...弾当たり男性大けが2023年 小国町 [nita★]
- 【実況】博衣こよりのえちえちダンガンロンパ2🧪★1
- 【実況】博衣こよりのえちえちダンガンロンパ2🧪★2
- 【美しい国】こども食堂、激増中!ありがとう安倍 [219241683]
- 【悲報】高市早苗、被災民に対し「自分の命くらいは自分で守ってくださいね」と切り捨てし大炎上 [339712612]
- 自民党稲田朋美、法務大臣にブチギレ 「高市早苗の再審法案は無罪の証拠隠し放題でクソ」 [175344491]
- 「日中緊張状態の責任は?」高市首相「まず私たちが誇りに思わなければならないのは、戦後、日本は世界の平和に貢献をし歩んできた」 [115996789]
