0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Finderの名前順ソートのルール(未解決)

Posted at

概要

  • Finderの並び順のルールがきになったので少し試してみた
    • これといった情報は見つからず仕舞い
    • こちらはただ一旦集めた情報をまとめてみたという記事です

実証

  • 「み」「錦」「凸」の並び順を考える
  • 英語環境・日本語環境で並び順が異なる結果となる
  • それぞれの文字コードは以下の通り

http://charset.7jp.net/dump.html

  • 英語環境下だと以下の並び
    • UTF-8での比較?

  • 日本語環境下だと以下の並び
    • Shift-JISでの比較?

  • 同じことをPythonで試してみた結果
names = ["", "", ""]
names_sorted_by_utf8 = sorted(names, key=lambda name: name)
names_sorted_by_sjis = sorted(names, key=lambda name: name.encode('shift_jis'))

print(f'utf8: {names_sorted_by_utf8}')
print(f'sjis: {names_sorted_by_sjis}')
utf8: ['み', '凸', '錦']
sjis: ['み', '錦', '凸']

その他考慮が必要そうなこと

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?