0

我知道如果路径有空格,可以使用\040对其进行编码:

路径示例:

“//服务器/带空格的文件夹”

fstab 条目:

//server/folder\040with\040spaces /mnt/share/folder_local cifs nofail,credentials=/root/.credfile 0 0

但是,如果您的路径包含非英语字符为'ñ' ,如何填写 fstab ?

路径示例:

"//server/folderWith-ñ-char"

我试过了:

fstab 条目:

//server/folderWith-\F1-char /mnt/share/folder_local cifs nofail,credentials=/root/.credfile 0 0

基于: https ://www.degraeve.com/reference/urlencoding.php

但我得到了错误:

 mount -a
mount error(2): No such file or directory
4

1 回答 1

1

只需 type //server/folderWith-ñ-charñ并没有什么特别之处。

如果出现问题,您可以mnt_mangle从 linux-util 使用。编译这个短程序:

$ printf "%s\n" '#include "libmount/libmount.h"' 'int main(int argc, char *argv[]) { puts(mnt_mangle(argv[1])); }' | gcc -xc - -lmount -o mnt_mangle

然后你可以使用:

$ ./mnt_mangle '//server/folderWith-ñ-char'
//server/folderWith-ñ-char
于 2022-02-23T10:57:50.853 回答