Issue 110222 - Problem opening files in already running instance if filename contains non-ASCII symbols (8-bit locales)
Summary: Problem opening files in already running instance if filename contains non-AS...
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: OOO320m12
Hardware: Unknown Linux, all
: P3 Trivial with 4 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Keywords: needhelp
Depends on:
Reported: 2010-03-18 14:53 UTC by alexpro
Modified: 2014-01-29 13:23 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

correction (2.79 KB, text/plain)
2010-03-18 14:54 UTC, alexpro
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description alexpro 2010-03-18 14:53:17 UTC
When OpenOffice is already running, some files can only be opened via
'Open File' dialog and not via command line. 
This happens with 8-bit encodings of filesystem.

To reproduce:
(assuming <ascii>.doc has only ascii symbols in name, <russian>.doc has some
cyrillic symbols)

1. First instance: ooffice
2. ooffice <ascii>.doc - ok, file opens in new window
3. ooffice /home/user/<ascii>.doc - ok, file opens in new window
4. ooffice <russian>.doc - error: file <garbage> not found
5. ooffice /home/user/<russian>.doc - nothing happens at all

The problem is caused by command line args encoding when sending
command line to pipe in /tmp.

There are two problems. First, if path is absolute, file name is not converted
to "file://" URL (sal/osl/unx/file_uri.cxx:488 - just returns on error).
Running process then just ignores it.

Second - file name is converted into UTF8 before sending. Running
process then just decodes file name from URL encoding and tries to open it.
This is ok, if filesystem is in UTF8 encoding, but for 8-bit locales UTF8
file name could not be opened.

I'm attaching patch, which solves those problems. It should work
on both UTF8 locales and 8-bit locales.

Additional information:
OS: Gentoo Linux
Arch: x86_64
Kernel: 2.6.32
Locale: ru_RU.KOI8-R, filesystem encoding is also KOI8-R,
Comment 1 alexpro 2010-03-18 14:54:05 UTC
Created attachment 68414 [details]