-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VS2005下日志路径不支持中文 #8
Comments
hi~ MoSights : 中文日志路径只在VS2005下才会出现 而setlocale是一个全局的调用 另外还有一个可能存在的候选方案是使用C的fopen接口 但还没有做过测试进行验证 ^ ^ 如果这个方案可行的话 在稍后的版本中会对此问题进行解决. 再次感谢! |
简单的写了个测试验证了fopen不存在[中文路径/带空格路径]不能识别的问题 查了下vs2005对中文路径支持的相关资料 如下所说: so . C 的fopen接口可以避免 |
新版本中已支持 谢谢提供建议. |
测试了下新版本,好像有问题,默认的主log的路径不能自定义的,也就是我设置了自定义路径,发现有两个log文件夹,一个是默认位置的log,一个是自定义的log 2013/5/29 zhangyawei notifications@github.com
|
主LOGGER的name是Main, 可通过配置文件增加[Main]段配置 或者在程序中调用CreateLogger("Main",....) 来进行定制, 参见advance例子. |
bool OpenLogger(LoggerId id)
{
...
setlocale(LC_ALL, "");
pLogger->_handle.open(path.c_str(), std::ios::app|std::ios::out|std::ios::binary); // std::fstream 在VS2005下打开中文路径的文件会出问题
setlocale(LC_ALL, "C");//还原
...
}
这是我目前的解决方法
The text was updated successfully, but these errors were encountered: