我们最近开始使用 p4api.net 并很快遇到了问题。该仓库包含许多名称中包含特殊字符的文件,尤其是德语变音符号 (ä,ö,ü,ß)。
使用命令行 (p4 sync) 时,文件已正确同步。使用 p4api.net 执行 SyncFiles 文件以不同方式同步,文件名包含像“ü”而不是“ü”这样的字符。是否有任何选项可以明确告诉 SyncFiles 或连接使用某种编码?
PS 环境变量 P4CHARSET 已经设置好了..
为了完成这里是我们用来同步的代码:
Server server = new Server(new ServerAddress(MainSettings.Default.Server));
Repository rep = new Repository(server);
Connection con = rep.Connection;
con.UserName = MainSettings.Default.User;
con.Client = new Client
{
Name = MainSettings.Default.Workspace
};
if (con.Connect(null))
{
foreach (var depot in MainSettings.Default.Depots)
{
var fileSpecList = con.Client.SyncFiles(null, FileSpec.ClientSpec(depot));
...
}
}