Bug 145758 - Wrong encoding in the window title, when saving a file, and when pasting from the clipboard
Summary: Wrong encoding in the window title, when saving a file, and when pasting from...
Status: RESOLVED DUPLICATE of bug 125995
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
6.4.7.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-18 14:28 UTC by stsav012
Modified: 2022-08-26 14:46 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Faulty encoding in the window title and in the menu (27.72 KB, image/png)
2021-11-18 19:57 UTC, stsav012
Details
Faulty encoding in the recent files list (25.81 KB, image/png)
2021-11-18 19:58 UTC, stsav012
Details
Faulty encoding in the recent files list in LO 7.1 from the LO website (198.52 KB, image/png)
2021-11-18 20:24 UTC, stsav012
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stsav012 2021-11-18 14:28:06 UTC
Description:
It seems that Windows-1252 encoding is used in the window title. It should be UTF-8.

Steps to Reproduce:
1. Create a new document/spreadsheet/whatever.
2. Save it under a name containing non-Unicode characters. Say, λιβρε.odt.
3. Look at the window title.

Actual Results:
The title and the last line in the Window menu looks like λιβÏε.odt.

Expected Results:
The window title and the last line in the Window menu should display λιβρε.odt.


Reproducible: Always


User Profile Reset: No



Additional Info:
Reproduced only under KDE Neon (user edition). kwrite and evince, for instance, display the correct file name in their titles, so the DE settings should not be an issue. In Fedora 33 to 35, and in Ubuntu 20.10, LO is fine.

Installed packages (although I tried without libreoffice-kde, libreoffice-kde5, libreoffice-kf5, libreoffice-qt5, too):

libreoffice-base-core
libreoffice-calc
libreoffice-common
libreoffice-core
libreoffice-kde5
libreoffice-kde
libreoffice-kf5
libreoffice-math
libreoffice-plasma
libreoffice-qt5
libreoffice-style-breeze
libreoffice-style-colibre
libreoffice-writer
Comment 1 Roman Kuznetsov 2021-11-18 19:29:14 UTC
Do you use LibreOffice from the official site or from your distro repos?
Comment 2 stsav012 2021-11-18 19:45:46 UTC
I tested both LO from the Ubuntu Focal repo (version 1:6.4.7-0ubuntu0.20.04.1) and from the LO PPA (https://launchpad.net/~libreoffice/+archive/ubuntu/ppa; version 7.2.2~rc2-0ubuntu0.20.04.1~lo1). The result was the same. Apparently, the problem is rare enough.
Comment 3 stsav012 2021-11-18 19:52:47 UTC
What's more, when I'm saving a file with a faulty name, the suggested filename in the saving dialog is the same garbage as in the window title. The same I see in the list of the recently opened files when I launch LibreOffice. It doesn't look to me like a DE issue at all.

I don't mind providing any information, whatever you need to narrow the problem down.
Comment 4 stsav012 2021-11-18 19:57:46 UTC
Created attachment 176352 [details]
Faulty encoding in the window title and in the menu
Comment 5 stsav012 2021-11-18 19:58:30 UTC
Created attachment 176353 [details]
Faulty encoding in the recent files list
Comment 6 Roman Kuznetsov 2021-11-18 20:06:10 UTC
Please try download and instal LibreOffice from https://libreoffice.org/download
Comment 7 stsav012 2021-11-18 20:24:06 UTC
Created attachment 176354 [details]
Faulty encoding in the recent files list in LO 7.1 from the LO website

Not to mix up the LO from the website with the one installed from the LO PPA, I picked LO 7.1.7, not the newest one. The result is the same. Should I purge all LO packages and repeat the installation of the website version?
Comment 8 stsav012 2021-11-18 20:32:24 UTC
Alright, I have purged everything relative to LO, both from the website and from the PPA. Then I installed LO 7.2.2.2-2 from the website. The result is the same, only the LO version differs:

Version: 7.2.2.2 / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 2; OS: Linux 5.11; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-US (C); UI: en-US
Calc: threaded
Comment 9 Ming Hua 2021-11-18 20:45:08 UTC
(In reply to stsav012 from comment #8)
> Version: 7.2.2.2 / LibreOffice Community
> Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
> CPU threads: 2; OS: Linux 5.11; UI render: default; VCL: kf5 (cairo+xcb)
> Locale: en-US (C); UI: en-US
The culprit is likely that you are using the bare C locale.  I don't think LibreOffice handles that very gracefully.  Please test again with a UTF-8 locale.  If you don't know how, I believe the following commands from a terminal should work:
$ export LANG=en-US.UTF-8
$ /opt/libreoffice7.2/program/soffice

> Calc: threaded
Comment 10 stsav012 2021-11-18 20:54:46 UTC
Indeed, the locale I use is C. The locale has been applied:
Locale: en-US (en-US.UTF-8); UI: en-US

However, running the two suggested commands has not resolved the issue.

As far as I understand, C locale is UTF-8, too, for Ubuntu (and its derivatives) uses UTF-8 as the default encoding for ages by now. Never mind.

It's getting late, I'll test other suggestions tomorrow.
Comment 11 stsav012 2021-11-24 10:29:33 UTC
I keep facing the problem. Now, I can't copy “ö” into the axis title of a LO Calc chart. Instead, I get “ö”. When I enter it manually, it is shown in the Titles dialog and as the axis title correctly. The issue is only with the clipboard (actually, both of them).

I can copy the axis title from LO Calc to LO Writer, it appears fine. But when I copy, for instance, the first few sentences of the comment from the browser, I get the following in LO Writer (forget the “>” sign):

> I keep facing the problem. Now, I can't copy âöâ into the axis title of a LO Calc chart. Instead, I get âöâ.

I haven't changed nor updated LibreOffice since last time:
Version: 7.2.2.2 / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 2; OS: Linux 5.11; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-US (C); UI: en-US
Calc: threaded
Comment 12 Kevin Suo 2021-11-24 11:30:14 UTC
Try 
$ export LANG=en-US.UTF-8

then open run libreoffice from the same terminal in which you have exported the LANG, rather than from the desktop application menu:
$ /opt/libreoffice7.2/program/soffice

If now it works, then it is due to your locale settings.

I once have set the lang to sth else (by mistake) and encountered the same issue.
Comment 13 stsav012 2021-11-24 11:37:26 UTC
See Comment #10 above. I did test it with `LANG=en-US.UTF-8` env variable set. No avail: the issue is still here.
Comment 14 stsav012 2021-11-24 11:42:34 UTC
And why do I face the issue only with LibreOffice? How's it different from the other apps I use? If I find another misbehaving app, I will narrow the problem down.
Comment 15 zxc.ohmvn 2022-02-02 19:58:32 UTC
I'd like to second this bug as well as highlight that this can occur when locale is set to ones such as Austrian English (en_AT), Belgian English (en_BE) and Swedish English (en_SE) and thus, is more of a concern than one might think - it is not limited to simply folks using uncommon and/or unusual locales.
Comment 16 ⁨خالد حسني⁩ 2022-08-26 14:46:23 UTC

*** This bug has been marked as a duplicate of bug 125995 ***