NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sending/receiving UTF-8 characters from terminal to program



On Wed, 18 Jan 2023, r0ller wrote:

Actually, it's just inconvenient to always type the strings what
I want to analyse in a program, compile and execute it instead of
giving it a go from the shell.


In a pinch, you can always use iconv(1) to do your conversions:

```
$ printf néz | hexdump -	# locale is en_GB.UTF-8 ie. UTF-8
00000000  6e c3 a9 7a                                       |n..z|
00000004
$ printf néz | iconv -f UTF-8 -t ISO-8859-1 | hexdump -C
00000000  6e e9 7a                                          |n.z|
00000003
$
```

-RVP


Home | Main Index | Thread Index | Old Index