Created attachment 57440 [details] Correctly transform abs. paths to URLs When LibreOffice is already running, opening new files with national characters in name fails when local filename encoding is not UTF8. Steps to reproduce: (assume, that locale is ru_RU.KOI8-R and filenames are encoded in KOI8-R) 1. Create file пример.odt 2. Start lowriter 3a. Run libreoffice --writer пример.odt This produces an error in started instance 'file <utf bytes> not found' 3b. Run libreoffice --writer /abs/path/to/пример.odt This makes no response at all. In both cases file пример.odt should be opened. Attached patches correct this problems.
Created attachment 57441 [details] Correctly decode arguments when file encoding is not UTF8 The xTranslator->translateToInternal expects input to be in local encoding, while oosplash converts all arguments to UTF prior to encoding. Using INetURLObject::translateToInternal transforms URL correctly.
Thanks for the patch Alex, can you please confirm that you submitted this under MPL/LGPLv3+?
(In reply to comment #2) > Thanks for the patch Alex, can you please confirm that you submitted this under > MPL/LGPLv3+? Yes, of course. The patches are under MPL/LGPLv3+
The real problem is that CommandLineArgs::ParseCommandLine_Impl (desktop/source/app/cmdlineargs.cxx) traditionally assumes URL arguments to be in "external" (cf. documentation in udkapi/com/sun/star/uri/XExternalUriReferenceTranslator.idl) form while send_args (desktop/unx/source/start.c) erroneously sends them in "internal" form. In some cases, INetURLObject::translateToInternal is resilient to input that is already in "internal" form, but that is more good luck than proper design.
Stephan Bergmann committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=cf4416a68fb68f36cf9065c6d08d14dd22637b24 fdo#46434: No need to turn arguments into absolute file URLs when sending
Alex, can you check whether the commit mentioned in comment 5 solves the problem for you?
I've just tried to remove code block as in commit and russian (KOI8-R) file names don't work - no response at all. ASCII files, though, open with absolute and relative file paths. (previous patch with INetUrlObj was also removed).
I can insert some debug code and post results if required.
Stephan Bergmann committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=8bbf048085066b8e95256e7d59d7ddd89465d4e7 fdo#46434: Always send command line arguments as UTF-8
Alex, I hope the second commit (see comment 9) fixes it now.
Yes, with latest patch everything works as expected. Tried both KOI8-R and UTF-8 encodings and both relative and abs. paths. Thanks!