You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I managed to fix the issue by tweaking the method DBObject::quote() in database.cpp, but I'm not good in C++, and I guess this is not the right way to handle utf-8 characters...
diff --git a/src/database.cpp b/src/database.cpp
index 08c47e8..82059e6 100644
--- a/src/database.cpp+++ b/src/database.cpp@@ -457,28 +457,28 @@ const string DBObject::quote(const char * value) {
/**
* Returns a quoted string suitable for insertion into the DB.
* Converts an empty string to null. Removes unprintable characters.
* Replaces all single-quotes with double single quotes in the output string.
*/
const string DBObject::quote(const string & in) {
if (in.empty()) return "null";
string out = "'";
- char c;+ unsigned char c;
for (string::const_iterator i = in.begin(), e = in.end(); i != e; ++i) {
c = *i;
switch (c) {
case '\n': // fallthrough
case '\t':
out.push_back(c);
break;
case '\'':
out.push_back(c); // fallthrough
default:
- if (isprint(c)) out.push_back(c);+ if (c >= 0x20 && c != 0x7f) out.push_back(c);
}
}
out.push_back('\'');
return out;
}
Would this patch be eligible for a PR?
Or what else could be done in order to fix this issue?
dajoha
changed the title
Accentuated characters are dropped in the database
UTF-8 characters are dropped in the database
Feb 5, 2021
I have the given folder in my filesystem:
But in the ASH sqlite database, the accentuated character
é
of the folder name has been dropped everywhere.I.e., the
cwd
value is:The following columns of the table
commands
have this kind of issue:cwd
command
I have checked many entries in the table
commands
, and I can notice that all accentuated characters have been dropped.The text was updated successfully, but these errors were encountered: