Windows: use wide char interfaces
Exchange file names and command line parameters with the system using wchar_t interfaces: allows preserving values which can be reversibly transcoded in the current multibyte charset (which can't be UTF-8). Store all file paths internally in UTF-8
This commit is contained in:
@@ -341,7 +341,7 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
|
||||
// If using an actual file, check that it exists, and if it is
|
||||
// compressed, we may need an uncompressed version
|
||||
if (!fn.empty() && theconfig->mimeViewerNeedsUncomp(doc.mimetype)) {
|
||||
if (access(fn.c_str(), R_OK) != 0) {
|
||||
if (!path_readable(fn)) {
|
||||
QMessageBox::warning(0, "Recoll",
|
||||
tr("Can't access file: ") + u8s2qs(fn));
|
||||
return;
|
||||
@@ -445,9 +445,13 @@ void RclMain::execViewer(const map<string, string>& subs, bool enterHistory,
|
||||
#endif
|
||||
QStatusBar *stb = statusBar();
|
||||
if (stb) {
|
||||
string fcharset = theconfig->getDefCharset(true);
|
||||
string prcmd;
|
||||
#ifdef _WIN32
|
||||
prcmd = ncmd;
|
||||
#else
|
||||
string fcharset = theconfig->getDefCharset(true);
|
||||
transcode(ncmd, prcmd, fcharset, "UTF-8");
|
||||
#endif
|
||||
QString msg = tr("Executing: [") +
|
||||
QString::fromUtf8(prcmd.c_str()) + "]";
|
||||
stb->showMessage(msg, 10000);
|
||||
|
||||
Reference in New Issue
Block a user