Skip to content
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

dict文件夹路径包含中文时崩溃 #169

Open
siren186 opened this issue Sep 22, 2022 · 1 comment
Open

dict文件夹路径包含中文时崩溃 #169

siren186 opened this issue Sep 22, 2022 · 1 comment

Comments

@siren186
Copy link

cppjieba::Jieba构造函数如下,参数为std::string

Jieba(const string& dict_path, 
        const string& model_path,
        const string& user_dict_path, 
        const string& idfPath, 
        const string& stopWordPath) 

读取文件时,因为中文是以UTF-8编码存储在std::string中的,所以会造成找不到指定的文件,打开文件失败。

ifstream ifs(filePath.c_str());
@HuangYoutian
Copy link

同样问题,解决办法用不带中文的相对路径

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants