Windows 资源管理器使用的排序顺序中的第一个字符是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4290541/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 07:47:41  来源:igfitidea点击:

What is the first character in the sort order used by Windows Explorer?

windowsalgorithmprogramming-languagescharspecial-characters

提问by shxfee

For example, in a Windows folder, if we create some files and name them 1.html, 2.txt, 3.txt, photo.jpg, zen.png the order will be as is. But if we create another file with the name _file.doc it will be placed at the top. (considering we sort by name in descending order)

例如,在 Windows 文件夹中,如果我们创建一些文件并将它们命名为 1.html, 2.txt, 3.txt, photo.jpg, zen.png 则顺序将不变。但是如果我们创建另一个名为 _file.doc 的文件,它将被放置在顶部。(考虑到我们按名称降序排序)

likewise, what would be the character that would be considered as the first, such that if i use that character, it would place the file on top of the hierarchy?

同样,将被视为第一个的字符是什么,这样如果我使用该字符,它会将文件放在层次结构的顶部?

采纳答案by limitfan

The first visible character is '!' according to ASCII table.And the last one is '~' So "!file.doc" or "~file.doc' will be the top one depending your ranking order. You can check the ascii table here: http://www.asciitable.com/

第一个可见字符是“!” 根据 ASCII 表。最后一个是 '~' 所以 "!file.doc" 或 "~file.doc' 将是最上面的,取决于你的排名顺序。你可以在这里查看 ascii 表: http://www .asciitable.com/

回答by Chad Stilwell

I had the same problem. I wanted to 'bury' a folder at the bottom of the sort instead of bringing it to the top with the '!' character. Windows recognizes most special characters as just that, 'special', and therefore they ALL are sorted at the top.

我有同样的问题。我想在排序的底部“埋葬”一个文件夹,而不是用“!”将它带到顶部。特点。Windows 将大多数特殊字符识别为“特殊”,因此它们都排在最前面。

However, if you think outside of the English characters, you will find a lot of luck. I used Character Map and the arial font, scrolled down past '~' and the others to the greek alphabet. Capitol Xi, Ξ, worked best for me, but I didn't check to see which was the actual 'lowest' in the sort.

但是,如果你在英文字符之外思考,你会发现很多运气。我使用了字符映射表和 arial 字体,向下滚动到“~”和其他的希腊字母表。Capitol Xi, Ξ,对我来说效果最好,但我没有检查哪个是同类中实际的“最低”。

回答by hmuelner

If you google for sort order windows exploreryou will find out that Windows Explorer (since Windows XP) obviously uses the function StrCmpLogicalWin the sort order "by name". I did not find information about the treatment of the underscore character. I was amused by the following notein the documentation:

如果您在 Windows 资源管理器中搜索排序顺序,您会发现 Windows 资源管理器(自 Windows XP 起)显然在“按名称”排序顺序中使用了StrCmpLogicalW函数。我没有找到有关处理下划线字符的信息。我被文档中的以下注释逗乐了:

Behavior of this function, and therefore the results it returns, can change from release to release. ...

这个函数的行为,因此它返回的结果,可能会随着版本的不同而改变。...

回答by Douglas Chapman

I know it's an old question, but it's easy to check this out. Just create a folder with a bunch of dummy files whose names are each character on the keyboard. Of course, you can't really use \ | / : * ? " < > and leading and trailing blanks are a terrible idea.

我知道这是一个老问题,但很容易检查出来。只需创建一个包含一堆虚拟文件的文件夹,其名称是键盘上的每个字符。当然,你不能真正使用\ | / : * ? " < > 以及前导和尾随空格是一个糟糕的主意。

If you do this, and it looks like no one did, you find that the Windows sort order for the FIRST character is 1. Special characters 2. Numbers 3. Letters

如果您这样做,并且看起来没有人这样做,您会发现第一个字符的 Windows 排序顺序是 1.特殊字符 2.数字 3.字母

But for subsequent characters, it seems to be 1. Numbers 2. Special characters 3. Letters

但是对于后面的字符,好像是1.数字2.特殊字符3.字母

Numbers are kind of weird, thanks to the "Improvements" made after the Y2K non-event. Special characters you would think would sort in ASCII order, but there are exceptions, notably the first two, apostrophe and dash, and the last two, plus and equals. Also, I have heard but not actually seen something about dashes being ignored. That is, in fact, NOT my experience.

数字有点奇怪,这要归功于 Y2K 非事件之后的“改进”。您会认为特殊字符会按 ASCII 顺序排序,但也有例外,特别是前两个,撇号和破折号,以及后两个,加号和等号。另外,我听说过但实际上没有看到有关忽略破折号的内容。也就是说,事实上,不是我的经验。

So, ShxFee, I assume you meant the sort should be ascending, not descending, and the top-most (first) character in the sort order for the first character of the name is the apostrophe.

所以,ShxFee,我假设您的意思是排序应该是升序,而不是降序,并且名称第一个字符的排序顺序中最上面(第一个)字符是撇号。

As NigelTouch said, special characters do not sort to ASCII, but my notes above specify exactly what does and does not sort in normal ASCII order. But he is certainly wrong about special characters always sorting first. As I noted above, that only appears to be true for the first character of the name.

正如 NigelTouch 所说,特殊字符不会按 ASCII 排序,但我上面的注释准确指定了按正常 ASCII 顺序排序和不排序的内容。但他对特殊字符总是先排序的说法肯定是错误的。正如我上面提到的,这似乎只适用于名称的第一个字符。

回答by CodeManX

Only a few characters in the Windows code page 1252 (Latin-1) are not allowed as names. Note that the Windows Explorer will strip leading spaces from names and not allow you to call a files space dot something (like ?.txt), although this is allowed in the file system! Only a space and no file extension is invalid however.

只有 Windows 代码页 1252 (Latin-1) 中的几个字符不允许作为名称。请注意,Windows 资源管理器将从名称中去除前导空格,并且不允许您调用文件空间点(例如?.txt),尽管这在文件系统中是允许的!但是只有一个空格和没有文件扩展名是无效的。

If you create files through e.g. a Python script (this is what I did), then you can easily find out what is actually allowed and in what order the characters get sorted. The sort order varies based on your locale!Below are the results of my script, run with Python 2.7.15 on a GermanWindows 10 Pro 64bit:

如果您通过例如 Python 脚本创建文件(这就是我所做的),那么您可以轻松找出实际允许的内容以及字符排序的顺序。排序顺序因您的语言环境而异!以下是我的脚本的结果,在德语Windows 10 Pro 64 位上使用 Python 2.7.15 运行:

Allowed:

允许:

       32  20  SPACE
!      33  21  EXCLAMATION MARK
#      35  23  NUMBER SIGN
$      36  24  DOLLAR SIGN
%      37  25  PERCENT SIGN
&      38  26  AMPERSAND
'      39  27  APOSTROPHE
(      40  28  LEFT PARENTHESIS
)      41  29  RIGHT PARENTHESIS
+      43  2B  PLUS SIGN
,      44  2C  COMMA
-      45  2D  HYPHEN-MINUS
.      46  2E  FULL STOP
/      47  2F  SOLIDUS
0      48  30  DIGIT ZERO
1      49  31  DIGIT ONE
2      50  32  DIGIT TWO
3      51  33  DIGIT THREE
4      52  34  DIGIT FOUR
5      53  35  DIGIT FIVE
6      54  36  DIGIT SIX
7      55  37  DIGIT SEVEN
8      56  38  DIGIT EIGHT
9      57  39  DIGIT NINE
;      59  3B  SEMICOLON
=      61  3D  EQUALS SIGN
@      64  40  COMMERCIAL AT
A      65  41  LATIN CAPITAL LETTER A
B      66  42  LATIN CAPITAL LETTER B
C      67  43  LATIN CAPITAL LETTER C
D      68  44  LATIN CAPITAL LETTER D
E      69  45  LATIN CAPITAL LETTER E
F      70  46  LATIN CAPITAL LETTER F
G      71  47  LATIN CAPITAL LETTER G
H      72  48  LATIN CAPITAL LETTER H
I      73  49  LATIN CAPITAL LETTER I
J      74  4A  LATIN CAPITAL LETTER J
K      75  4B  LATIN CAPITAL LETTER K
L      76  4C  LATIN CAPITAL LETTER L
M      77  4D  LATIN CAPITAL LETTER M
N      78  4E  LATIN CAPITAL LETTER N
O      79  4F  LATIN CAPITAL LETTER O
P      80  50  LATIN CAPITAL LETTER P
Q      81  51  LATIN CAPITAL LETTER Q
R      82  52  LATIN CAPITAL LETTER R
S      83  53  LATIN CAPITAL LETTER S
T      84  54  LATIN CAPITAL LETTER T
U      85  55  LATIN CAPITAL LETTER U
V      86  56  LATIN CAPITAL LETTER V
W      87  57  LATIN CAPITAL LETTER W
X      88  58  LATIN CAPITAL LETTER X
Y      89  59  LATIN CAPITAL LETTER Y
Z      90  5A  LATIN CAPITAL LETTER Z
[      91  5B  LEFT SQUARE BRACKET
\     92  5C  REVERSE SOLIDUS
]      93  5D  RIGHT SQUARE BRACKET
^      94  5E  CIRCUMFLEX ACCENT
_      95  5F  LOW LINE
`      96  60  GRAVE ACCENT
a      97  61  LATIN SMALL LETTER A
b      98  62  LATIN SMALL LETTER B
c      99  63  LATIN SMALL LETTER C
d     100  64  LATIN SMALL LETTER D
e     101  65  LATIN SMALL LETTER E
f     102  66  LATIN SMALL LETTER F
g     103  67  LATIN SMALL LETTER G
h     104  68  LATIN SMALL LETTER H
i     105  69  LATIN SMALL LETTER I
j     106  6A  LATIN SMALL LETTER J
k     107  6B  LATIN SMALL LETTER K
l     108  6C  LATIN SMALL LETTER L
m     109  6D  LATIN SMALL LETTER M
n     110  6E  LATIN SMALL LETTER N
o     111  6F  LATIN SMALL LETTER O
p     112  70  LATIN SMALL LETTER P
q     113  71  LATIN SMALL LETTER Q
r     114  72  LATIN SMALL LETTER R
s     115  73  LATIN SMALL LETTER S
t     116  74  LATIN SMALL LETTER T
u     117  75  LATIN SMALL LETTER U
v     118  76  LATIN SMALL LETTER V
w     119  77  LATIN SMALL LETTER W
x     120  78  LATIN SMALL LETTER X
y     121  79  LATIN SMALL LETTER Y
z     122  7A  LATIN SMALL LETTER Z
{     123  7B  LEFT CURLY BRACKET
}     125  7D  RIGHT CURLY BRACKET
~     126  7E  TILDE
\x7f  127  7F  DELETE
\x80  128  80  EURO SIGN
\x81  129  81  
\x82  130  82  SINGLE LOW-9 QUOTATION MARK
\x83  131  83  LATIN SMALL LETTER F WITH HOOK
\x84  132  84  DOUBLE LOW-9 QUOTATION MARK
\x85  133  85  HORIZONTAL ELLIPSIS
\x86  134  86  DAGGER
\x87  135  87  DOUBLE DAGGER
\x88  136  88  MODIFIER LETTER CIRCUMFLEX ACCENT
\x89  137  89  PER MILLE SIGN
\x8a  138  8A  LATIN CAPITAL LETTER S WITH CARON
\x8b  139  8B  SINGLE LEFT-POINTING ANGLE QUOTATION
\x8c  140  8C  LATIN CAPITAL LIGATURE OE
\x8d  141  8D  
\x8e  142  8E  LATIN CAPITAL LETTER Z WITH CARON
\x8f  143  8F  
\x90  144  90  
\x91  145  91  LEFT SINGLE QUOTATION MARK
\x92  146  92  RIGHT SINGLE QUOTATION MARK
\x93  147  93  LEFT DOUBLE QUOTATION MARK
\x94  148  94  RIGHT DOUBLE QUOTATION MARK
\x95  149  95  BULLET
\x96  150  96  EN DASH
\x97  151  97  EM DASH
\x98  152  98  SMALL TILDE
\x99  153  99  TRADE MARK SIGN
\x9a  154  9A  LATIN SMALL LETTER S WITH CARON
\x9b  155  9B  SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
\x9c  156  9C  LATIN SMALL LIGATURE OE
\x9d  157  9D  
\x9e  158  9E  LATIN SMALL LETTER Z WITH CARON
\x9f  159  9F  LATIN CAPITAL LETTER Y WITH DIAERESIS
\xa0  160  A0  NON-BREAKING SPACE
\xa1  161  A1  INVERTED EXCLAMATION MARK
\xa2  162  A2  CENT SIGN
\xa3  163  A3  POUND SIGN
\xa4  164  A4  CURRENCY SIGN
\xa5  165  A5  YEN SIGN
\xa6  166  A6  PIPE, BROKEN VERTICAL BAR
\xa7  167  A7  SECTION SIGN
\xa8  168  A8  SPACING DIAERESIS - UMLAUT
\xa9  169  A9  COPYRIGHT SIGN
\xaa  170  AA  FEMININE ORDINAL INDICATOR
\xab  171  AB  LEFT DOUBLE ANGLE QUOTES
\xac  172  AC  NOT SIGN
\xad  173  AD  SOFT HYPHEN
\xae  174  AE  REGISTERED TRADE MARK SIGN
\xaf  175  AF  SPACING MACRON - OVERLINE
\xb0  176  B0  DEGREE SIGN
\xb1  177  B1  PLUS-OR-MINUS SIGN
\xb2  178  B2  SUPERSCRIPT TWO - SQUARED
\xb3  179  B3  SUPERSCRIPT THREE - CUBED
\xb4  180  B4  ACUTE ACCENT - SPACING ACUTE
\xb5  181  B5  MICRO SIGN
\xb6  182  B6  PILCROW SIGN - PARAGRAPH SIGN
\xb7  183  B7  MIDDLE DOT - GEORGIAN COMMA
\xb8  184  B8  SPACING CEDILLA
\xb9  185  B9  SUPERSCRIPT ONE
\xba  186  BA  MASCULINE ORDINAL INDICATOR
\xbb  187  BB  RIGHT DOUBLE ANGLE QUOTES
\xbc  188  BC  FRACTION ONE QUARTER
\xbd  189  BD  FRACTION ONE HALF
\xbe  190  BE  FRACTION THREE QUARTERS
\xbf  191  BF  INVERTED QUESTION MARK
\xc0  192  C0  LATIN CAPITAL LETTER A WITH GRAVE
\xc1  193  C1  LATIN CAPITAL LETTER A WITH ACUTE
\xc2  194  C2  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
\xc3  195  C3  LATIN CAPITAL LETTER A WITH TILDE
\xc4  196  C4  LATIN CAPITAL LETTER A WITH DIAERESIS
\xc5  197  C5  LATIN CAPITAL LETTER A WITH RING ABOVE
\xc6  198  C6  LATIN CAPITAL LETTER AE
\xc7  199  C7  LATIN CAPITAL LETTER C WITH CEDILLA
\xc8  200  C8  LATIN CAPITAL LETTER E WITH GRAVE
\xc9  201  C9  LATIN CAPITAL LETTER E WITH ACUTE
\xca  202  CA  LATIN CAPITAL LETTER E WITH CIRCUMFLEX
\xcb  203  CB  LATIN CAPITAL LETTER E WITH DIAERESIS
\xcc  204  CC  LATIN CAPITAL LETTER I WITH GRAVE
\xcd  205  CD  LATIN CAPITAL LETTER I WITH ACUTE
\xce  206  CE  LATIN CAPITAL LETTER I WITH CIRCUMFLEX
\xcf  207  CF  LATIN CAPITAL LETTER I WITH DIAERESIS
\xd0  208  D0  LATIN CAPITAL LETTER ETH
\xd1  209  D1  LATIN CAPITAL LETTER N WITH TILDE
\xd2  210  D2  LATIN CAPITAL LETTER O WITH GRAVE
\xd3  211  D3  LATIN CAPITAL LETTER O WITH ACUTE
\xd4  212  D4  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
\xd5  213  D5  LATIN CAPITAL LETTER O WITH TILDE
\xd6  214  D6  LATIN CAPITAL LETTER O WITH DIAERESIS
\xd7  215  D7  MULTIPLICATION SIGN
\xd8  216  D8  LATIN CAPITAL LETTER O WITH SLASH
\xd9  217  D9  LATIN CAPITAL LETTER U WITH GRAVE
\xda  218  DA  LATIN CAPITAL LETTER U WITH ACUTE
\xdb  219  DB  LATIN CAPITAL LETTER U WITH CIRCUMFLEX
\xdc  220  DC  LATIN CAPITAL LETTER U WITH DIAERESIS
\xdd  221  DD  LATIN CAPITAL LETTER Y WITH ACUTE
\xde  222  DE  LATIN CAPITAL LETTER THORN
\xdf  223  DF  LATIN SMALL LETTER SHARP S
\xe0  224  E0  LATIN SMALL LETTER A WITH GRAVE
\xe1  225  E1  LATIN SMALL LETTER A WITH ACUTE
\xe2  226  E2  LATIN SMALL LETTER A WITH CIRCUMFLEX
\xe3  227  E3  LATIN SMALL LETTER A WITH TILDE
\xe4  228  E4  LATIN SMALL LETTER A WITH DIAERESIS
\xe5  229  E5  LATIN SMALL LETTER A WITH RING ABOVE
\xe6  230  E6  LATIN SMALL LETTER AE
\xe7  231  E7  LATIN SMALL LETTER C WITH CEDILLA
\xe8  232  E8  LATIN SMALL LETTER E WITH GRAVE
\xe9  233  E9  LATIN SMALL LETTER E WITH ACUTE
\xea  234  EA  LATIN SMALL LETTER E WITH CIRCUMFLEX
\xeb  235  EB  LATIN SMALL LETTER E WITH DIAERESIS
\xec  236  EC  LATIN SMALL LETTER I WITH GRAVE
\xed  237  ED  LATIN SMALL LETTER I WITH ACUTE
\xee  238  EE  LATIN SMALL LETTER I WITH CIRCUMFLEX
\xef  239  EF  LATIN SMALL LETTER I WITH DIAERESIS
\xf0  240  F0  LATIN SMALL LETTER ETH
\xf1  241  F1  LATIN SMALL LETTER N WITH TILDE
\xf2  242  F2  LATIN SMALL LETTER O WITH GRAVE
\xf3  243  F3  LATIN SMALL LETTER O WITH ACUTE
\xf4  244  F4  LATIN SMALL LETTER O WITH CIRCUMFLEX
\xf5  245  F5  LATIN SMALL LETTER O WITH TILDE
\xf6  246  F6  LATIN SMALL LETTER O WITH DIAERESIS
\xf7  247  F7  DIVISION SIGN
\xf8  248  F8  LATIN SMALL LETTER O WITH SLASH
\xf9  249  F9  LATIN SMALL LETTER U WITH GRAVE
\xfa  250  FA  LATIN SMALL LETTER U WITH ACUTE
\xfb  251  FB  LATIN SMALL LETTER U WITH CIRCUMFLEX
\xfc  252  FC  LATIN SMALL LETTER U WITH DIAERESIS
\xfd  253  FD  LATIN SMALL LETTER Y WITH ACUTE
\xfe  254  FE  LATIN SMALL LETTER THORN
\xff  255  FF  LATIN SMALL LETTER Y WITH DIAERESIS

Forbidden:

禁止:

\x00    0  00  NULL CHAR
\x01    1  01  START OF HEADING
\x02    2  02  START OF TEXT
\x03    3  03  END OF TEXT
\x04    4  04  END OF TRANSMISSION
\x05    5  05  ENQUIRY
\x06    6  06  ACKNOWLEDGEMENT
\x07    7  07  BELL
\x08    8  08  BACK SPACE
\t      9  09  HORIZONTAL TAB
\n     10  0A  LINE FEED
\x0b   11  0B  VERTICAL TAB
\x0c   12  0C  FORM FEED
\r     13  0D  CARRIAGE RETURN
\x0e   14  0E  SHIFT OUT / X-ON
\x0f   15  0F  SHIFT IN / X-OFF
\x10   16  10  DATA LINE ESCAPE
\x11   17  11  DEVICE CONTROL 1 (OFT. XON)
\x12   18  12  DEVICE CONTROL 2
\x13   19  13  DEVICE CONTROL 3 (OFT. XOFF)
\x14   20  14  DEVICE CONTROL 4
\x15   21  15  NEGATIVE ACKNOWLEDGEMENT
\x16   22  16  SYNCHRONOUS IDLE
\x17   23  17  END OF TRANSMIT BLOCK
\x18   24  18  CANCEL
\x19   25  19  END OF MEDIUM
\x1a   26  1A  SUBSTITUTE
\x1b   27  1B  ESCAPE
\x1c   28  1C  FILE SEPARATOR
\x1d   29  1D  GROUP SEPARATOR
\x1e   30  1E  RECORD SEPARATOR
\x1f   31  1F  UNIT SEPARATOR
"      34  22  QUOTATION MARK
*      42  2A  ASTERISK
:      58  3A  COLON
<      60  3C  LESS-THAN SIGN
>      62  3E  GREATER-THAN SIGN
?      63  3F  QUESTION MARK
|     124  7C  VERTICAL LINE

Screenshotof how Explorer sorts the files for me:

Explorer 如何为我排序文件的屏幕截图

German Windows Explorer

德语 Windows 资源管理器

The highlighted file with the ? white smiley facewas added manually by me (Alt+1) to show where this Unicode character (U+263A) ends up, see Jimbugs' answer.

突出显示的文件?白色笑脸是我手动添加的 (Alt+1) 以显示此 Unicode 字符 (U+263A) 的最终位置,请参阅Jimbugs 的回答

The first file has a space as name (0x20), the second is the non-breaking space (0xa0). The files in the bottom half of the third row which look like they have no name use the characters with hex codes 0x81, 0x8D, 0x8F, 0x90, 0x9D (in this order from top to bottom).

第一个文件有一个空格作为名称(0x20),第二个是不间断空格(0xa0)。第三行下半部分看起来没有名称的文件使用十六进制代码 0x81、0x8D、0x8F、0x90、0x9D(按从上到下的顺序)的字符。

回答by Jimbugs

I know there is already an answer - and this is an old question - but I was wondering the same thing and after finding this answer I did a little experimentation on my own and had (IMO) a worthwhile addition to the discussion.

我知道已经有答案了——这是一个老问题——但我想知道同样的事情,在找到这个答案后,我自己做了一些实验,并且(IMO)对讨论进行了有价值的补充。

The non-visible characters can still be used in a folder name - a placeholder is inserted - but the sort on ASCII value still seems to hold.

不可见字符仍可用于文件夹名称 - 插入占位符 - 但 ASCII 值排序似乎仍然成立。

I tested on Windows7, holding down the alt-key and typing in the ASCII code using the numeric keypad. I did not test very many, but was successful creating foldernames that started with ASCII 1, ASCII 2, and ASCII 3. Those correspond with SOH, STX and ETX. Respectively it displayed happy face, filled happy face, and filled heart.

我在 Windows7 上进行了测试,按住 alt 键并使用数字键盘输入 ASCII 代码。我没有测试太多,但成功创建了以 ASCII 1、ASCII 2 和 ASCII 3 开头的文件夹名。那些对应于 SOH、STX 和 ETX。分别表现出幸福的脸庞,充满幸福的脸庞,充满内心的喜悦。

I'm not sure if I can duplicate that here - but I will type them in on the next lines and submit.

我不确定我是否可以在这里复制它 - 但我会在下一行输入它们并提交。

?foldername

?文件夹名称

?foldername

?文件夹名称

?foldername

?文件夹名称

回答by Fuzzical Logic

Ugh, I wish I could comment on this. Alas, not yet... Just a clarfication on Dialecticus' comment... Not an answer really.

呃,我希望我能对此发表评论。唉,还没有......只是对辩证法评论的澄清......真的不是一个答案。

Actually, you can start with white space for a filename. Not all whitespace is allowed, however. For instance, you may not start with a breaking space (spacebar), but you may start with a non-breaking space (alt 255).

实际上,您可以从文件名的空格开始。然而,并非所有空格都被允许。例如,您可能不会以换行符(空格键)开头,但可以从不换行符(alt 255)开始。

In regard to the sort order, Shafee, this depends only upon the application that is reading the files. There is no "default" sort order except order of creation. Now if you are talking in Explorer directly, this depends on your sort method. It looks as if you are talking as in sort by name, if this is the case, then the answer is the character that is determined by alt-10. Be careful using characters like this, as not all apps or operations are compatible with alt text. This number may also be different when considering unicode characters.

关于排序顺序,Shafee,这仅取决于读取文件的应用程序。除了创建顺序外,没有“默认”排序顺序。现在,如果您直接在 Explorer 中交谈,这取决于您的排序方法。看起来好像是按名称排序,如果是这种情况,那么答案就是由 alt-10 确定的字符。小心使用这样的字符,因为并非所有应用程序或操作都与替代文本兼容。在考虑 unicode 字符时,这个数字也可能不同。

回答by u8it

From my testing, there are three criteria for sorting characters as described below. Aside from this, shorter strings are sorted above longer strings that start with the same characters.

根据我的测试,有以下三个字符排序标准。除此之外,较短的字符串排序在以相同字符开头的较长字符串之上。

Note:This testing only looked at the first character sorting and did not look into edge cases described by this answer, which found that, for all characters after the first character, numbers take precedence over symbols (i.e. the order is 1. Symbols 2. Numbers 3. Letters for first character, 1. Numbers 2. Symbols 3. Letters after). This answer also indicated that the Unicode/ASCII layer of sorting might not be entirely consistent. I'll update this answer if I get time to look into these edge cases.

注意:此测试仅查看第一个字符排序,并没有查看此答案描述的边缘情况,它发现,对于第一个字符之后的所有字符,数字优先于符号(即顺序为 1。符号 2。数字 3. 第一个字符的字母,1. 数字 2. 符号 3. 后面的字母)。这个答案还表明 Unicode/ASCII 排序层可能不完全一致。如果我有时间研究这些边缘情况,我会更新这个答案。

Note:It's important to note that sorting order might be subject to change as described by this answer. It is not clear to me though the extent to which this actually ever changes. I've done this testing and found it to be valid on both Windows 7 and Windows 10.

注意:请务必注意,排序顺序可能会按照此答案所述进行更改。我不清楚这实际上改变的程度。我已经完成了这个测试,发现它在 Windows 7 和 Windows 10 上都有效。



Symbols
Latin (ordered by Unicode value (U+xxxx))
Greek (ordered by Unicode value (U+xxxx))
Cyrillic (ordered by Unicode value (U+xxxx))
Hebrew (ordered by Unicode value (U+xxxx))
Arabic (ordered by Unicode value (U+xxxx))

符号
拉丁语(按 Unicode 值 (U+xxxx)
排序)希腊语(按 Unicode 值 (U+xxxx)
排序)西里尔文(按 Unicode 值 (U+xxxx)
排序)希伯来语(按 Unicode 值 (U+xxxx) 排序)
阿拉伯语(按 Unicode 值 (U+xxxx) 排序)

Numbers
Latin (ordered by Unicode value (U+xxxx))
Greek (ordered by Unicode value (U+xxxx))
Cyrillic (ordered by Unicode value (U+xxxx))
Hebrew (ordered by Unicode value (U+xxxx))
Arabic (ordered by Unicode value (U+xxxx))

数字
拉丁语(按 Unicode 值 (U+xxxx)
排序)希腊语(按 Unicode 值 (U+xxxx)
排序)西里尔文(按 Unicode 值 (U+xxxx)
排序)希伯来语(按 Unicode 值 (U+xxxx) 排序)
阿拉伯语(按 Unicode 值 (U+xxxx) 排序)

Letters
Latin (ordered by Unicode value (U+xxxx))
Greek (ordered by Unicode value (U+xxxx))
Cyrillic (ordered by Unicode value (U+xxxx))
Hebrew (ordered by Unicode value (U+xxxx))
Arabic (ordered by Unicode value (U+xxxx))

字母
拉丁语(按 Unicode 值 (U+xxxx)
排序)希腊语(按 Unicode 值 (U+xxxx)
排序)西里尔字母(按 Unicode 值 (U+xxxx)
排序)希伯来语(按 Unicode 值 (U+xxxx) 排序)
阿拉伯语(按 Unicode 值 (U+xxxx) 排序)

enter image description here

在此处输入图片说明



Sorting Rule Sequence vs Observed Order

排序规则序列与观察顺序

It's worth noting that there are really two ways of looking at this. Ultimately, what you have are sorting rules that are applied in a certain order, in turn, this produces an observed order. The ordering of older rules becomes nested under the ordering of newer rules. This means that the first rule applied is the last rule observed, while the last rule applied is the first or topmost rule observed.

值得注意的是,实际上有两种看待这个的方式。最终,您拥有的是按特定顺序应用的排序规则,反过来,这会产生一个观察到的顺序。旧规则的排序嵌套在新规则的排序之下。这意味着应用的第一个规则是观察到的最后一个规则,而应用的最后一个规则是观察到的第一个或最上面的规则。

Sorting Rule Sequence

排序规则序列

1.) Sort on Unicode Value (U+xxxx)
2.) Sort on culture/language
3.) Sort on Type (Symbol, Number, Letter)

1.) 按 Unicode 值 (U+xxxx)
排序 2.) 按文化/语言
排序 3.) 按类型(符号、数字、字母)排序

Observed Order

观察顺序

  • The highest level of grouping is by type in the following order...

    1.) Symbols
    2.) Numbers
    3.) Letters

    Therefore, any symbol from any language comes before any number from any language, while any letter from any language appears after all symbols and numbers.

  • The second level of grouping is by culture/language. The following order seems to apply for this:

    Latin
    Greek
    Cyrillic
    Hebrew
    Arabic

  • The lowest rule observed is Unicode order, so items within a type-language group are ordered by Unicode value (U+xxxx).

  • 最高级别的分组按类型按以下顺序...

    1.) 符号
    2.) 数字
    3.) 字母

    因此,任何语言的任何符号都出现在任何语言的任何数字之前,而任何语言的任何字母都出现在所有符号和数字之后。

  • 分组的第二级是按文化/语言。以下顺序似乎适用于此:

    拉丁语
    希腊语
    西里尔语
    希伯来语
    阿拉伯语

  • 观察到的最低规则是 Unicode 顺序,因此类型语言组中的项目按 Unicode 值 (U+xxxx) 排序。



Adapted from here: https://superuser.com/a/971721/496260

改编自:https: //superuser.com/a/971721/496260

回答by Didi

Although the answer with "!" was chosen as the correct answer, this is NOT true. I′m not sure about Windows Explorer in Windows 10/8.1/8, but I am certain concerning Windows 7 and XP.

虽然答案是“!” 被选为正确答案,这不是真的。我不确定 Windows 10/8.1/8 中的 Windows Explorer,但我确定 Windows 7 和 XP。

The character that moves your filename to the very top is "'" (alt+39), and second best is "-" (the minus sign).

将文件名移到最顶部的字符是“'”(alt+39),第二好的字符是“-”(减号)。

But sorting order in Windows Explorer is more complicated - it depends on the filename-lenght also, and numbers are treated very special.

但是 Windows 资源管理器中的排序顺序更复杂 - 它也取决于文件名长度,并且数字被非常特殊对待。

The second character (and the following) is treated different. Here you often go best with a " " (spacebar), followed by the characters mentioned above, but you′ll have to try out, because it′s not so easy to find out the exact algorithm:

第二个字符(以及以下字符)的处理方式不同。在这里,您通常最好使用“”(空格键),然后是上面提到的字符,但您必须尝试一下,因为找出确切的算法并不容易:

Here is an example for the correct sorting order for your understanding:

以下是正确排序顺序的示例,以供您理解:

  1. file: "'"
  2. file: "''" (longer filename)
  3. file: "'''" (and so on)
  4. file: "-"
  5. file: "--"
  6. file: "---" (and so on)
  7. file: "- -" (spacebar used)
  8. file: "' '" (spacebar twotimes, therefore longer filename)
  9. file: "' ' '" (most top character, but longer filename!)
  10. file: "'' 0" (shorter filename, but chars like numbers came in)
  1. 文件:“ '
  2. 文件:“ ''”(更长的文件名)
  3. 文件:“ '''”(等等)
  4. 文件:“ -
  5. 文件:“ ——
  6. 文件:“ ---”(等等)
  7. 文件:“ - -”(使用空格键)
  8. 文件:“ ''”(空格键两次,因此文件名更长)
  9. 文件:“ ' ' '”(最上面的字符,但文件名更长!)
  10. 文件:“ '' 0”(较短的文件名,但输入了数字等字符)

Another example:

另一个例子:

  1. "'' aaaa" ("'" is better than spacebar and spacebar is better than "a")
  2. "'' aaaaa"
  3. "' aaaaaa"
  1. " '' aaaa" (" '" 比空格键好,空格键比 " a" 好)
  2. ''啊啊啊
  3. '啊啊啊

Same filelenght:

相同的文件长度:

  1. "-- aa" (spacebar comes before "-" in this case!)
  2. "---aa"
  3. "--aaa"
  1. -- aa”(在这种情况下,空格键在“-”之前!)
  2. ---aa
  3. " --aaa"

Finally the very special logic when it comes to numbers:

最后是关于数字的非常特殊的逻辑:

  1. "0000000"
  2. "0"
  3. "00001"
  1. 0000000
  2. 0
  3. 00001

But nevertheless: Renaming folders or files this way, you can quickly find what you are searching for.

尽管如此:通过这种方式重命名文件夹或文件,您可以快速找到您要搜索的内容。

回答by Nogitsune

TLDR; technically space sorts before exclamation mar, and can be used by preceding it with ' or - (which will be ignored in sorting), but exclamation mark follows right after space, and is easier to use.

TLDR;从技术上讲,空格在感叹号之前排序,并且可以在它前面加上 ' 或 - (在排序时将被忽略)使用,但感叹号紧跟在空格之后,并且更易于使用。

On windows 7 at least, a minus sign (-) and (') seem to be ignored in a name except for one quirk: in a name that is otherwise identical, the ' will be sorted before -, for example: (a'a) will sort above (a-a)

至少在 Windows 7 上,除一个怪癖外,名称中的减号 (-) 和 (') 似乎被忽略:在其他方面相同的名称中,' 将排在 - 之前,例如:(a' a) 将排序高于 (aa)

Empty string will sort above everything else, which means for example aa will sort above aaa because the 'empty string' after two a letters will sort before the third 'a'.

空字符串将排序在其他所有内容之上,这意味着例如 aa 将排序在 aaa 之上,因为两个 a 字母之后的“空字符串”将在第三个字母 'a' 之前排序。

This also means that aa will be sorted above a'a because the 'empty string' between two a letters will sort above the ' mark.

这也意味着 aa 将排在 a'a 上方,因为两个 a 字母之间的“空字符串”将排在 ' 标记上方。

What follows then is, ' alone will sort first, because technically it's an empty string. However adding for example letters behind it will sort the name as if the ' didn't exist.

接下来是, ' 单独将首先排序,因为从技术上讲它是一个空字符串。但是,在其后面添加例如字母将对名称进行排序,就好像 ' 不存在一样。

Since the first 'unignored' character (as far as I know) is space, in case you want to sort 'real names' above others, the best way to go would be ' followed by space, and then the name you want to actually use. For example: (' first)

由于第一个“未忽略”字符(据我所知)是空格,如果您想将“真实姓名”排序在其他字符之上,最好的方法是 ' 后跟空格,然后是您想要实际使用的名称用。例如:('第一个)

You can of course top that by using more than one space in the strong, such as (' firster) and (' firstest) with two and three blanks before the f.

当然,您可以通过在强中使用多个空格来超越它,例如 (' firster) 和 (' firstest) 在 f 前有两个和三个空格。

While minus sign sorts below ' in otherwise similar name, there's no other difference in sorting (that I know of), and I find minus sign visually clearer, so if I want to put something on top of list, I'd use minus followed by space, then the 'actual name', for example: (- first file -)

虽然减号在 ' 下方以其他相似的名称排序,但排序方面没有其他区别(我知道),而且我发现减号在视觉上更清晰,所以如果我想把一些东西放在列表的顶部,我会使用减号按空格,然后是“实际名称”,例如:(-第一个文件-)

If you are worried about using space on the filename, then exclamation mark (!) is the next best thing - and since it can appear as first character on a string, it's easier to use.

如果您担心在文件名上使用空格,那么感叹号 (!) 是下一个最好的选择 - 因为它可以作为字符串的第一个字符出现,所以使用起来更容易。