Bug 1480778 - Tree doesn't display non-ASCII correctly
Tree doesn't display non-ASCII correctly
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: tree (Show other bugs)
26
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Kamil Dudka
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-11 16:59 EDT by Göran Uddeborg
Modified: 2017-08-17 20:26 EDT (History)
2 users (show)

See Also:
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:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-17 20:26:24 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Göran Uddeborg 2017-08-11 16:59:47 EDT
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 04:43:05 EDT
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@redhat.com> - 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@fedoraproject.org> - 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 04:48:39 EDT
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 02:23:10 EDT
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-17 20:26:24 EDT
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.