且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SVN 错误:无法将字符串从本机编码转换为“UTF-8"

更新时间:2023-11-27 12:00:40

  1. 它不会改变文件的编码.它更改了文件名的编码(希望每个客户都能理解).
  2. 谁允许的?NTFS 使用 16 位代码点,Windows 可以根据您要求的方式以各种编码公开文件名(它会尝试将它们转换为您要求的编码).现在......那一点(你怎么问)取决于你使用的特定 svn 客户端.在我看来,这像是 TortoiseSVN 中的一个错误.

编辑添加:

呃.我误解了症状.svn 服务器以 utf-8 格式存储所有内容(似乎它成功地做到了).

Ugh. I misunderstood the symptoms. the svn server stores everything in utf-8 (and it seems that it did that successfully).

提交后钩子是无法从 UTF-8 转换的位.如果我理解你的意思,服务器上的提交后钩子会触发对共享驱动器的 svn 更新(因此 svn 服务器启动了一个 svn 客户端到自己......)?这意味着需要修复的配置是客户端在服务器上的配置.在执行 svn 服务器的环境中检查 LANG/LC_ALL..碰巧的是,钩子在 真空环境(见提示).所以你应该在钩子本身中设置变量.

The post-commit hook is the bit that fails to convert from UTF-8. If I understand what you're saying correctly, the post-commit hook on the server triggers an svn update to a shared drive (the svn server therefore starts an svn client to itself...) ? This means that the configuration that needs to be fixed is the one for the client on the server. Check the LANG / LC_ALL on the environment executing the svn server.. As it happens, the hooks are run in a vacuum environment (see Tip). So you should set the variable in the hook itself.

另请参阅此页面了解如何svn 处理本地化

See also this page for info on how svn handles localisation