Bug 199005 - Unable to escape \n
Summary: Unable to escape \n
Status: RESOLVED FIXED
Alias: None
Product: kdialog
Classification: Applications
Component: general (show other bugs)
Version: 1.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Brad Hards
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-05 13:14 UTC by Andreas Stangl
Modified: 2012-07-02 14:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.9


Attachments
Unable to escape \n (37.20 KB, image/png)
2009-07-05 13:16 UTC, Andreas Stangl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Stangl 2009-07-05 13:14:19 UTC
Version:           1.0 (using KDE 4.2.4)
Compiler:          gcc-4.3.3 CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"m CHOST="x86_64-pc-linux-gnu"
OS:                Linux
Installed from:    Gentoo Packages

It seems that kdialog can not identify escaped \n (= \\n), the \n is does always result in a newline. When I try to replace the backslash character with the html entity \ then #92; is displayed instead of the backslash. (see screenshot)

I came up to this problem when trying to display a windows-like path that is passed to wine.
Comment 1 Andreas Stangl 2009-07-05 13:16:19 UTC
Created attachment 35062 [details]
Unable to escape \n

The upper kdialog call is unable to escape \n via \\n.
The lower call shows that kdialog can not translate the html entity for a backslash.
Comment 2 Pino Toscano 2009-07-05 13:48:22 UTC
$ kdialog --sorry 'foo<press Enter>
> oob'
Comment 3 Andreas Stangl 2009-07-05 14:30:21 UTC
(In reply to comment #2)
> $ kdialog --sorry 'foo<press Enter>
> > oob'

What do you mean with this? I want to display a string like 'foo\noob', i.e. the path 'C:\program files\notepad'
Comment 4 Pino Toscano 2009-07-06 00:37:13 UTC

*** This bug has been marked as a duplicate of bug 148575 ***
Comment 5 Andreas Stangl 2009-07-06 07:27:04 UTC
bug 148575 means that \n is _not_ translated to a newline, this is the other way around: \n cannot be escaped, therefore it is not possible to have the _string_ \n inside a dialog _without_ being translated to a newline. Any \n inside a string _is_ translated into a newline.
Comment 6 Andreas Stangl 2009-07-06 07:28:56 UTC
bug 148575 means that \n is _not_ translated to a newline, this is the other way around: \n cannot be escaped, therefore it is not possible to have the _string_ \n inside a dialog _without_ being translated to a newline. Any \n inside a string _is_ translated into a newline.
Comment 7 Andreas Stangl 2009-07-06 07:46:53 UTC
sorry for the double post, it seems bugs.kde.org has some network/database troubles or my network connection is very bad :-(
Comment 8 Oswald Buddenhagen 2012-07-01 11:20:30 UTC
Git commit 03e91d5242ac80c4923fc55f7e9c27a0acbcb762 by Oswald Buddenhagen.
Committed on 01/07/2012 at 12:39.
Pushed by ossi into branch 'master'.

make backslashes escapable
FIXED-IN: 4.9

M  +1    -6    kdialog/kdialog.cpp
M  +32   -0    kdialog/widgets.cpp
M  +1    -0    kdialog/widgets.h

http://commits.kde.org/kde-baseapps/03e91d5242ac80c4923fc55f7e9c27a0acbcb762
Comment 9 Christoph Feck 2012-07-02 14:48:39 UTC
Git commit b619b55abcefd1b28fc47644030de69f6fdccda1 by Christoph Feck, on behalf of Oswald Buddenhagen.
Committed on 01/07/2012 at 12:39.
Pushed by cfeck into branch 'KDE/4.9'.

make backslashes escapable
FIXED-IN: 4.9
(cherry picked from commit 03e91d5242ac80c4923fc55f7e9c27a0acbcb762)

M  +1    -6    kdialog/kdialog.cpp
M  +32   -0    kdialog/widgets.cpp
M  +1    -0    kdialog/widgets.h

http://commits.kde.org/kde-baseapps/b619b55abcefd1b28fc47644030de69f6fdccda1