aboutsummaryrefslogtreecommitdiffstats
path: root/lib/parsetools/src/leex.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2016-09-29 08:27:39 +0200
committerHans Bolinder <[email protected]>2016-09-29 08:27:39 +0200
commit8bde09c998c68265361155aa8ed188aa0e2a4a44 (patch)
tree8452843d8d3f58a2086eb19978d5919ea53ebebf /lib/parsetools/src/leex.erl
parentdabc6644991a6e732dc4404433215d1333a0ea07 (diff)
parentf738330c5588f5e2ad7e3661c675bbffb4795850 (diff)
downloadotp-8bde09c998c68265361155aa8ed188aa0e2a4a44.tar.gz
otp-8bde09c998c68265361155aa8ed188aa0e2a4a44.tar.bz2
otp-8bde09c998c68265361155aa8ed188aa0e2a4a44.zip
Merge branch 'hasse/parsetools/fix_leex_unicode/OTP-13919' into maint
* hasse/parsetools/fix_leex_unicode/OTP-13919: parsetools: Correct handling of Unicode in Leex
Diffstat (limited to 'lib/parsetools/src/leex.erl')
-rw-r--r--lib/parsetools/src/leex.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/parsetools/src/leex.erl b/lib/parsetools/src/leex.erl
index 15d42a4d9c..602e47404d 100644
--- a/lib/parsetools/src/leex.erl
+++ b/lib/parsetools/src/leex.erl
@@ -1586,6 +1586,8 @@ out_dfa_graph(St, DFA, DF) ->
case file:open(St#leex.gfile, [write]) of
{ok,Gfile} ->
try
+ %% Set the same encoding as infile:
+ set_encoding(St, Gfile),
io:fwrite(Gfile, "digraph DFA {~n", []),
out_dfa_states(Gfile, DFA, DF),
out_dfa_edges(Gfile, DFA),
@@ -1621,7 +1623,7 @@ out_dfa_edges(File, DFA) ->
foreach(fun (T) ->
Crs = orddict:fetch(T, Tdict),
Edgelab = dfa_edgelabel(Crs),
- io:fwrite(File, " ~b -> ~b [label=\"~s\"];~n",
+ io:fwrite(File, " ~b -> ~b [label=\"~ts\"];~n",
[S,T,Edgelab])
end, sort(orddict:fetch_keys(Tdict)))
end, DFA).