iproute2: raw and buggy
For ip link at least, even control characters 0x1 .. 0x1f (only some of which are not allowed in interface names) are output raw which is invalid in JSON.
$ ifname=$'\1\xe9' $ sudo ip link add name $ifname type dummy $ sudo ip link add name $ifname type dummy (added twice! First time got renamed to __).
$ ip l [...] 14: __: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 12:22:77:40:6f:8c brd ff:ff:ff:ff:ff:ff 15: �: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 12:22:77:40:6f:8c brd ff:ff:ff:ff:ff:ff $ ip -j l | sed -n l [...] dcast":"ff:ff:ff:ff:ff:ff"},{"ifindex":14,"ifname":"__","flags":["BRO\ ADCAST","NOARP"],"mtu":1500,"qdisc":"noop","operstate":"DOWN","linkmo\ de":"DEFAULT","group":"default","txqlen":1000,"link_type":"ether","ad\ dress":"12:22:77:40:6f:8c","broadcast":"ff:ff:ff:ff:ff:ff"},{"ifindex\ ":15,"ifname":"\001\351","flags":["BROADCAST","NOARP"],"mtu":1500,"qd\ isc":"noop","operstate":"DOWN","linkmode":"DEFAULT","group":"default"\ ,"txqlen":1000,"link_type":"ether","address":"12:22:77:40:6f:8c","bro\ adcast":"ff:ff:ff:ff:ff:ff"}]$ $ ip -V ip utility, iproute2-6.5.0, libbpf 1.2.2