From 46d43ea41686d2d73c5f1826fb35878531cd63a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Niemier?= <~@hauleth.dev> Date: Sat, 24 Jan 2026 23:09:03 +0100 Subject: [PATCH] Printable charlists should be formatted as values without quotes --- src/e9p_sysfs.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/e9p_sysfs.erl b/src/e9p_sysfs.erl index 78fc83d..4b1db0d 100644 --- a/src/e9p_sysfs.erl +++ b/src/e9p_sysfs.erl @@ -126,7 +126,11 @@ open(_FID, [~"system_info", KeyB], _Mode, State) -> Key = binary_to_atom(KeyB), Data = case erlang:system_info(Key) of Val when is_binary(Val) -> Val; - Val -> iolist_to_binary(io_lib:format("~p", [Val])) + Val -> + case io_lib:printable_list(Val) of + true -> unicode:characters_to_binary(Val); + false -> iolist_to_binary(io_lib:format("~p", [Val])) + end end, {ok, {Data, 0}, State}; %% ===== Processes ===== -- 2.51.2