Bug 2240460

Summary: terminal uses ISO-8859-1 despite locale specifying UTF-8
Product: [Fedora] Fedora Reporter: Karsten Kretschmer <kkretschmer>
Component: rxvt-unicodeAssignee: Dave Cantrell <dcantrell>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 39CC: amurdaca, andreas.bierfert, dbrendel, dcantrell
Target Milestone: ---Keywords: Desktop, Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-10-06 06:28:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Karsten Kretschmer 2023-09-24 15:48:14 UTC
The terminal interprets data to be printed as encoded in ISO-8859-1 despite the locale setting being a .UTF-8 one.

Reproducible: Always

Steps to Reproduce:
1.start urxvt256c-ml with a UTF-8 locale, e.g. LC_ALL=en_US.UTF-8
2.echo '\0xbd'
  echo '\xe2\x82\xac'
3.observe screen output
Actual Results:  
½
â¬

Expected Results:  
<empty string>
€


rxvt-unicode-9.31-4.fc39.x86_64
tested on:
- Xwayland (xorg-x11-server-Xwayland-23.2.1-1.fc39.x86_64)
- SSH forwarding from a CentOS 9-Stream X11 session (tigervnc-server-minimal-1.13.1-2.el9.x86_64)
- Xephyr session within Xwayland (xorg-x11-server-Xephyr-1.20.14-24.fc39.x86_64)
- Xvfb (xorg-x11-server-Xvfb-1.20.14-24.fc39.x86_64)

Comment 1 Karsten Kretschmer 2023-09-24 16:49:27 UTC
On F38, "/usr/bin/echo -e '\xbd'" also outputs "½" despite this being an invalid UTF-8 sequence (rxvt-unicode-9.31-2.fc38.x86_64, tigervnc-server-minimal-1.13.1-3.fc38.x86_64).

$ /usr/bin/echo -e '\xbd'
½
$ /usr/bin/echo -e '\xbd' | iconv -f UTF-8 -t UCS-4BE | hexdump -C
iconv: (stdin):1:0: cannot convert
$ /usr/bin/echo -e '\xe2\x82\xac'
€
$ /usr/bin/echo -e '\xe2\x82\xac' | iconv -f UTF-8 -t UCS-4BE | hexdump -C
00000000  00 00 20 ac 00 00 00 0a                           |.. .....|
00000008

Comment 2 Dennis Brendel 2023-10-06 06:28:37 UTC
That's a duplicate of #2240458. Upgrading to perl-5.38.0-501 fixes this issue.

$ echo $'\0xbd'

$ echo $'\xe2\x82\xac'
€

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