Bug 105432

Summary: libvisio: cannot define default language for imported document
Product: LibreOffice Reporter: Mike Kaganski <mikekaganski>
Component: filters and storageAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED    
Severity: enhancement CC: dtardon, fridrich.strba
Priority: medium Keywords: filter:visio
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=98291
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Visio doc where Russian text is imported as garbage

Description Mike Kaganski 2017-01-19 05:25:20 UTC
Created attachment 130543 [details]
Visio doc where Russian text is imported as garbage

Currently there's no way to define default language used in libvisio on importing files when an object does not define a codepage in file.

Then in libvisio::VSDContentCollector::appendCharacters(), default clause sets hardcoded value "windows-1252".

Can a way be added to libvisio (ant maybe other DLPs) to specify default language on init (e.g. in writerperfect::detail::ImportFilterImpl<Generator>::filter() as an (optional?) argument? Then it would be possible to use LO's default document language for that purpose (and thus it would be user-controllable), like is currently done for e.g. DXF.

The attachment is an VSD document which contents is in Russian, but isn't detected as such, and is imported as garbage.
Comment 1 Fridrich Strba 2017-01-19 08:55:25 UTC
No need to put default encoding. I found the bug. We are basically assuming that the text is ANSI for all text in versions <= 6. It will nevertheless take some time here to fix, since in one block of text we can have several fonts and thus several encodings. We will have to change the way how we iterate over the chars.
Comment 2 Fridrich Strba 2017-01-31 16:31:55 UTC
IMHO, this commit https://cgit.freedesktop.org/libreoffice/libvisio/commit/?id=94f36d00499808d7588a0970ce0dc7470d1245c7 fixes the issue.
Comment 3 Mike Kaganski 2017-01-31 16:39:58 UTC
Thank you Fridrich! We will see that as soon as libvisio gets updated, right?
Comment 4 Fridrich Strba 2017-01-31 16:46:03 UTC
(In reply to Mike Kaganski from comment #3)
> Thank you Fridrich! We will see that as soon as libvisio gets updated, right?

Depends, if you use a distro that has system libvisio, just to build the current git master and install it on your system could work. As long as you use the same install path as the system one. If you are on Windows, you will have to wait for official release and its integration to libreoffice.