Hello
When I try to calculate the Hash of the file with Unicode characters, it
shows the following errors:
terminate called after throwing an instance of
'CryptoPP::FileStore::OpenErr'
what(): FileStore: error opening file for reading:
C:/é “/テã‚ストファイル.txt
I compiled Crypto++
I tried two methods:
1.
void CryptoHashes::makeFileHash(const QString )
{
FileSource f(filePath.toStdString().c_str(), true, new HashFilter(hash, new
HexEncoder(new StringSink(digest;
}
2.
void CryptoHashes::makeFileHash(const QString )
{
std::filesystem::path _path {
Hi Jeffrey Walton
Sorry I answered late.
std::filesystem::path _path {
std::filesystem::u8path(filePath.toStdString()) };
std::string _path_string { _path.u8string() };
std::ifstream m_file(_path_string, std::ios::in);
FileSource f(m_file, true, new HashFilter(hash, new HexEncoder(new
Hi One Sini
Thanks for your reply, but my problem is not related to file permission or
insufficient privileges. No errors occurred when I do this operation with
English characters, but errors occur when I use UTF-8 characters. I think
the Cryptopp library has a problem with UTF-8
Thanks to Jeffrey Walton and coshvji cujmlqef
I tried both of your methods but they both print the following errors:
terminate called after throwing an instance of
'CryptoPP::FileStore::ReadErr'
what(): FileStore: error reading file
--
You received this message because you are subscribed to