[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
read -N and UTF-8 characters
From: |
Stephane Chazelas |
Subject: |
read -N and UTF-8 characters |
Date: |
Thu, 6 Apr 2017 15:15:46 +0100 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
Using "read -N" on text containing multi-byte characters
produces incorrect result.
On Debian amd64 with the latest code from git:
$ locale charmap
UTF-8
$ printf '\ue9VWXYZ' | ./bash -c 'IFS= read -rN4 a; printf %s "$a"' | hd
00000000 c3 58 a9 56 57 |.X.VW|
00000005
(expected c3 a9 56 57 58)
$ ./bash --version
GNU bash, version 4.4.12(6)-maint (x86_64-unknown-linux-gnu)
[...]
It seems to be a regression (since 4.3). It was working OK with 4.2
--
Stephane
- read -N and UTF-8 characters,
Stephane Chazelas <=