Ubuntu 服务器中的 Unicode 字符

Jam*_*mes 10 rsync filesystems unicode ubuntu-server

我最近从 Ubuntu Desktop 13.04 迁移到 Ubuntu Server 13.10,现在我的文件系统似乎不支持 unicode 字符。我使用 rsync 来备份/同步文件,它显示了正确的字符,但它想删除不匹配的文件名并创建一个转义版本。

例如:

root@ubuntu-server:~# rsync -avh --progress --delete --dry-run --exclude \$RECYCLE.BIN /media/source/ /media/target/

deleting Tiësto - Ten Seconds Before Sunrise.mp3
Ti\#353sto - Ten Seconds Before Sunrise.mp3
Run Code Online (Sandbox Code Playgroud)

另外,如果我将 unicode 文件复制到文件系统,它会显示为:

drwxr-xr-x 3 root root      4096 Jan 21  2013 DJ Ti?sto/
Run Code Online (Sandbox Code Playgroud)

我尝试通过安装 unicode 库,apt-get install unicode但这似乎没有解决问题。

更新:现在这可能是内核问题。我正在复制 samba/cifs 并尝试通过指定 utf8 字符集,mount -t cifs //192.xxx.xxx.xxx/source/ /media/target/ -o iocharset=utf8但这会产生错误...

mount error(79): Can not access a needed shared library
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Run Code Online (Sandbox Code Playgroud)

检查内核日志揭示了这个小宝石:

root@ubuntu-server:~# tail /var/log/kern.log
Nov 30 03:51:33 ubuntu-server kernel: [ 1756.518222] CIFS VFS: CIFS mount error: iocharset utf8 not found
Run Code Online (Sandbox Code Playgroud)

如何在内核中获得 utf8 支持?

有任何想法吗?

Jam*_*mes 10

好的,经过上面的故障排除和大量的谷歌搜索......我发现了这个错误报告,其中解释了解决方案。基本上,如果您执行 Ubuntu Server Minimal 安装,您将获得最少的驱动程序。我猜有人认为 utf8 不够重要,无法包含在最少的驱动程序集中。因此,如果您进行了该安装类型,则需要稍后安装该linux-image-extra-virtual软件包以获得 utf8 支持。232 MB 的附加驱动程序来支持 utf8 字符集......高效。:-/ 无论如何这解决了问题。

root@ubuntu-server:~# apt-get install linux-image-extra-virtual
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
    crda iw libnl-3-200 libnl-genl-3-200 linux-firmware linux-image-3.11.0-13-generic
    linux-image-extra-3.11.0-13-generic linux-image-generic wireless-regdb
The following NEW packages will be installed:
    crda iw libnl-3-200 libnl-genl-3-200 linux-firmware linux-image-3.11.0-13-generic
    linux-image-extra-3.11.0-13-generic linux-image-extra-virtual
    linux-image-generic wireless-regdb
0 upgraded, 10 newly installed, 0 to remove and 12 not upgraded.
Need to get 73.5 MB of archives.
After this operation, 232 MB of additional disk space will be used.
Run Code Online (Sandbox Code Playgroud)

测试 utf8 文件副本:

root@ubuntu-server:~# cp -a /media/source/DJ* /media/target/.
Run Code Online (Sandbox Code Playgroud)

然后检查:

root@ubuntu-server:~# ll
drwxr-xr-x 3 root root      4096 Jan 21  2013 DJ Tiësto/
Run Code Online (Sandbox Code Playgroud)

更新 (2/22/2015):

您可能能够逃脱如果使用安装轻得多的--no-install-recommends参数apt-get我还没有尝试过,但是如果您遇到此问题,也许可以

你可以试试:

apt-get install --no-install-recommends linux-image-extra-virtual
Run Code Online (Sandbox Code Playgroud)

如果它不能解决问题,只需重新安装,但建议:

apt-get install --reinstall linux-image-extra-virtual
Run Code Online (Sandbox Code Playgroud)