This forum has been archived. All content is frozen. Please use KDE Discuss instead.

kdesudo double encodes the output?

Tags: None
(comma "," separated)
User avatar
blindvic
Registered Member
Posts
157
Karma
0
OS

kdesudo double encodes the output?

Mon Nov 17, 2014 7:14 am
Code: Select all
$ locale
LANG=en_US.UTF-8
LANGUAGE=en
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=ru_RU.UTF-8
LC_TIME=ru_RU.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=ru_RU.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=ru_RU.UTF-8
LC_NAME=ru_RU.UTF-8
LC_ADDRESS=ru_RU.UTF-8
LC_TELEPHONE=ru_RU.UTF-8
LC_MEASUREMENT=ru_RU.UTF-8
LC_IDENTIFICATION=ru_RU.UTF-8
LC_ALL=
vic@vic ~/projects/mykde (master *) $ sudo date     
[sudo] password for vic:
Пн. нояб. 17 10:07:42 MSK 2014
vic@vic ~/projects/mykde (master *) $ kdesudo date
Ðн. ноÑб. 17 10:07:47 MSK 2014

Is this a `kdesudo` bug?
(See similar issue which explains double encoding: http://gehrcke.de/category/technology/c ... -encoding/ )
luebking
Karma
0
checked whether "kdesudo locale" is still correct?
User avatar
blindvic
Registered Member
Posts
157
Karma
0
OS
Here it is:
Code: Select all
$ kdesudo locale
LANG=en_US.UTF-8
LANGUAGE=en
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=ru_RU.UTF-8
LC_TIME=ru_RU.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=ru_RU.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=ru_RU.UTF-8
LC_NAME=ru_RU.UTF-8
LC_ADDRESS=ru_RU.UTF-8
LC_TELEPHONE=ru_RU.UTF-8
LC_MEASUREMENT=ru_RU.UTF-8
LC_IDENTIFICATION=ru_RU.UTF-8
LC_ALL=
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Can you please provide the output of "date" executed normally?
Also, as kdesudo is intended for graphical applications usually, does date work normally when executed in a root mode Konsole terminal?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
blindvic
Registered Member
Posts
157
Karma
0
OS
Code: Select all
$ date
Сб. нояб. 29 12:01:26 MSK 2014

$ sudo date
[sudo] password for vic:
Сб. нояб. 29 12:01:30 MSK 2014

$ kdesudo date
Сб. ноÑб. 29 12:01:33 MSK 2014
User avatar
blindvic
Registered Member
Posts
157
Karma
0
OS
bcooksley wrote:does date work normally when executed in a root mode Konsole terminal?

When I do `kdesudo konsole`:
Code: Select all
# date
Сб. нояб. 29 12:04:08 MSK 2014
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
The environment appears to be okay then. This does appear to be a misencoding of the output as you suspected. Can you confirm that the output is properly formed UTF-8?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
blindvic
Registered Member
Posts
157
Karma
0
OS
> Can you confirm that the output is properly formed UTF-8?

Not sure what you mean.
Code: Select all
$ kdesudo date | hexdump
0000000 90c3 9fc2 90c3 bdc2 202e 90c3 b4c2 90c3
0000010 b5c2 90c3 bac2 202e 3120 3120 3a34 3631
0000020 303a 2031 534d 204b 3032 3431 000a     
000002d

$ sudo date | hexdump
0000000 9fd0 bdd0 202e b4d0 b5d0 bad0 202e 3120
0000010 3120 3a34 3631 323a 2030 534d 204b 3032
0000020 3431 000a                             
0000023

$ kdesudo date
Ðн. дек.  1 14:14:22 MSK 2014

$ kdesudo date | ./fix.py
Пн. дек.  1 14:14:25 MSK 2014

$ cat fix.py
#! /usr/bin/env python3
import sys

for line in sys.stdin:
    sys.stdout.write(line.encode('raw_unicode_escape').decode("utf-8"))
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Okay, I would suggest filing a bug report against kdesudo in this case. I'm not entirely sure though who provides kdesudo - you might need to file this with your distribution instead of with KDE.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
blindvic
Registered Member
Posts
157
Karma
0
OS
Thanks, I submitted the bug here: https://bugs.launchpad.net/kdesudo/+bug/1398740


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot]