Bug 1480778 - Tree doesn't display non-ASCII correctly
Summary: Tree doesn't display non-ASCII correctly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: tree
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-11 20:59 UTC by Göran Uddeborg
Modified: 2017-08-18 00:26 UTC (History)
2 users (show)

Fixed In Version: tree-1.7.0-11.fc27 tree-1.7.0-11.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-18 00:26:24 UTC
Type: Bug


Attachments (Terms of Use)

Description Göran Uddeborg 2017-08-11 20:59:47 UTC
Description of problem:
If there are non-ASCII characters in a file or directory name, these are displayed as octal codes by tree.  This happens even in an UTF-8 locale.  (In the C locale it is expected.)


Version-Release number of selected component (if applicable):
tree-1.7.0-8.fc26.x86_64


How reproducible:
Every time


Steps to Reproduce:
1. mkdir -p tmp/åäö
2. tree tmp


Actual results:
tmp
└── \303\245\303\244\303\266


Expected results:
tmp
└── åäö


Additional info:
This is a packaging issue.  Upstreams "tree" handles it correctly.  But the make command in the spec file overrides the CFLAGS setting in the Makefile, breaking this.  Combining the two placing this command in the spec file will create a correct "tree" command.

make CFLAGS="$RPM_OPT_FLAGS $(getconf LFS_CFLAGS) -DLINUX -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" %{?_smp_mflags}

Comment 1 Kamil Dudka 2017-08-14 08:43:05 UTC
Thank you for reporting the bug!  It should be fixed by the following commit:

commit dc38b66fd0b300e0ea18d3731ecb772e325d618b (HEAD -> refs/remotes/origin/master, refs/remotes/origin/f26, refs/remotes/origin/HEAD)
Author: Kamil Dudka <kdudka@...>
Date:   Mon, 14 Aug 2017 10:29:15 +0200

    Resolves: #1480778 - do not escape UTF-8 chars in file names by default in UTF-8 locale

diff --git a/tree.spec b/tree.spec
index d3d2316..b569172 100644
--- a/tree.spec
+++ b/tree.spec
@@ -27,6 +27,9 @@ utility.
 %prep
 %autosetup -p1

+# do not escape UTF-8 chars in file names by default in UTF-8 locale (#1480778)
+sed -e 's/LINUX/__linux__/' -i tree.c
+
 %build
 make CFLAGS="$RPM_OPT_FLAGS $(getconf LFS_CFLAGS)" %{?_smp_mflags}

@@ -46,6 +49,7 @@ chmod -x $RPM_BUILD_ROOT%{_mandir}/man1/tree.1

 %changelog
 * Mon Aug 14 2017 Kamil Dudka <kdudka> - 1.7.0-11
+- do not escape UTF-8 chars in file names by default in UTF-8 locale (#1480778)
 - modernize spec file (Group, BuildRoot, autosetup, clean, defattr)

 * Thu Aug 03 2017 Fedora Release Engineering <releng> - 1.7.0-10


I wanted to put just a reference to that commit but Pagure gives me 404 on https://src.fedoraproject.org/rpms/tree :-/

Comment 2 Fedora Update System 2017-08-14 08:48:39 UTC
tree-1.7.0-11.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-a4e9eee1d3

Comment 3 Fedora Update System 2017-08-15 06:23:10 UTC
tree-1.7.0-11.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-a4e9eee1d3

Comment 4 Fedora Update System 2017-08-18 00:26:24 UTC
tree-1.7.0-11.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.