Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/694305e8-d7f8-800e-a8d8-fbf410be6545
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Assistant: じゃあ 実例ベースで一気に確認しよう。 === じゃあ 実例ベースで一気に確認しよう。 「同じ \ が、環境ごとにどう見えるか」ね。 ==== ### ==== <syntaxhighlight>C:\Users\mzm m>cd C:\Windows\System32 </syntaxhighlight> 表示 <syntaxhighlight>C:¥Users¥mzm m>cd C:¥Windows¥System32 </syntaxhighlight> * 見た目:¥ * 中身:\ * コピーしても問題なし ===== <syntaxhighlight>C:\Users\mzm m> ===== </syntaxhighlight> 表示 <syntaxhighlight>C:\Users\mzm m> </syntaxhighlight> * 見た目:\ * 中身:同じ ==== ### ==== <syntaxhighlight>PS C:\Users\mzm m> Get-ChildItem C:\Windows </syntaxhighlight> 表示 <syntaxhighlight>PS C:\Users\mzm m> Get-ChildItem C:\Windows </syntaxhighlight> * ほぼ必ず \ * ¥になることは稀 ==== <syntaxhighlight>/mnt/c/Users/mzm\ m ==== </syntaxhighlight> * \ はエスケープ用途 * 表示は常に \ * ¥ は一切出ない ==== ### ==== <syntaxhighlight>C:\Program Files\test </syntaxhighlight> 表示 <syntaxhighlight>C:¥Program Files¥test </syntaxhighlight> ===== <syntaxhighlight>C:\Program Files\test ===== </syntaxhighlight> 表示 <syntaxhighlight>C:\Program Files\test </syntaxhighlight> ==== | | | ==== | --- | --- | | | | | | | | | | ※ VS Code は普通プログラミング向けフォントなので \ ==== ### ==== 貼り付け先で確認: <syntaxhighlight lang="python">for c in "C:¥Windows": print(hex(ord(c))) </syntaxhighlight> 結果(¥に見えても): <syntaxhighlight>0x43 0x3a 0x5c 0x57 ... </syntaxhighlight> 👉 0x5C = バックスラッシュ ==== <syntaxhighlight>C:¥Windows ← 全角 ==== C:¥Windows ← 円記号 </syntaxhighlight> * Unicode: - ¥ → U+FFE5 - ¥ → U+00A5 * パスとして壊れる ==== - cmd + 日本語フォント → ¥に見える ==== '' ''PowerShell / VS Code → * * 今でも現役で混在 * 見た目で判断しない ===== : ===== 次は * 「どうやって本物の ¥ を見分けるか」 * 「フォントを変えられない環境での対策」 どっち行く?
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)