aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-03-05 10:01:18 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-05 10:01:18 +0100
commita7e85df0d940e7f99a61e99de5d1d3ad55cea648 (patch)
tree4ee2b8887c47d5f4c43bf4c18d06e211ab982a76 /lib
parent549785976441514377e1da14c5c1e7fb289456e0 (diff)
parent10de566e138bc167256fe1c4cc25f934887738d7 (diff)
downloadotp-a7e85df0d940e7f99a61e99de5d1d3ad55cea648.tar.gz
otp-a7e85df0d940e7f99a61e99de5d1d3ad55cea648.tar.bz2
otp-a7e85df0d940e7f99a61e99de5d1d3ad55cea648.zip
Merge branch 'egil/fix-ts_make-unicode/OTP-12536' into maint
* egil/fix-ts_make-unicode/OTP-12536: test_server: Let ts_make have a latin1 fallback
Diffstat (limited to 'lib')
-rw-r--r--lib/test_server/src/ts_make.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/test_server/src/ts_make.erl b/lib/test_server/src/ts_make.erl
index 8727f7ebfe..9cb77ecb12 100644
--- a/lib/test_server/src/ts_make.erl
+++ b/lib/test_server/src/ts_make.erl
@@ -67,7 +67,17 @@ get_port_data(Port, Last0, Complete0) ->
end.
update_last([C|Rest], Line, true) ->
- io:put_chars(list_to_binary(Line)), %% Utf-8 list to utf-8 binary
+ try
+ %% Utf-8 list to utf-8 binary
+ %% (e.g. we assume utf-8 bytes from port)
+ io:put_chars(list_to_binary(Line))
+ catch
+ error:badarg ->
+ %% io:put_chars/1 badarged
+ %% this likely means we had unicode code points
+ %% in our bytes buffer (e.g warning from gcc with åäö)
+ io:put_chars(unicode:characters_to_binary(Line))
+ end,
io:nl(),
update_last([C|Rest], [], false);
update_last([$\r|Rest], Result, Complete) ->