diff options
author | Anders Svensson <[email protected]> | 2014-03-31 10:58:29 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2014-03-31 10:58:29 +0200 |
commit | 19a391b42dffeb88b8ec615ca4cc3a8b4936f1a0 (patch) | |
tree | fea4a024f727383ca5970ebd301a76ca05bbdb84 /lib/diameter | |
parent | 12501a16ce960bfe778c319d17d0c4b7d0bb1d68 (diff) | |
parent | d1ceb909e8867b4dfd97130270ef16201cc3e27b (diff) | |
download | otp-19a391b42dffeb88b8ec615ca4cc3a8b4936f1a0.tar.gz otp-19a391b42dffeb88b8ec615ca4cc3a8b4936f1a0.tar.bz2 otp-19a391b42dffeb88b8ec615ca4cc3a8b4936f1a0.zip |
Merge branch 'anders/diameter/unicode/OTP-11686'
* anders/diameter/unicode/OTP-11686:
Use fun encoding to erl_parse:abstract/2
Adapt dictionary compilation to new default encoding
Diffstat (limited to 'lib/diameter')
-rw-r--r-- | lib/diameter/src/compiler/diameter_codegen.erl | 8 | ||||
-rw-r--r-- | lib/diameter/src/compiler/diameter_forms.hrl | 6 | ||||
-rw-r--r-- | lib/diameter/test/diameter_compiler_SUITE.erl | 10 |
3 files changed, 20 insertions, 4 deletions
diff --git a/lib/diameter/src/compiler/diameter_codegen.erl b/lib/diameter/src/compiler/diameter_codegen.erl index 22422f2ef2..5a068c1a25 100644 --- a/lib/diameter/src/compiler/diameter_codegen.erl +++ b/lib/diameter/src/compiler/diameter_codegen.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010-2013. All Rights Reserved. +%% Copyright Ericsson AB 2010-2014. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -31,7 +31,8 @@ %% on the beam file of another dictionary. %% --export([from_dict/4]). +-export([from_dict/4, + is_printable_ascii/1]). %% used by ?TERM/1 in diameter_forms.hrl -include("diameter_forms.hrl"). -include("diameter_vsn.hrl"). @@ -121,6 +122,9 @@ eraser(Key) -> %% =========================================================================== %% =========================================================================== +is_printable_ascii(C) -> + 16#20 =< C andalso C =< 16#7F. + get_value(Key, Plist) -> proplists:get_value(Key, Plist, []). diff --git a/lib/diameter/src/compiler/diameter_forms.hrl b/lib/diameter/src/compiler/diameter_forms.hrl index 9b14c1715a..dd03401b9e 100644 --- a/lib/diameter/src/compiler/diameter_forms.hrl +++ b/lib/diameter/src/compiler/diameter_forms.hrl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010-2013. All Rights Reserved. +%% Copyright Ericsson AB 2010-2014. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -57,4 +57,6 @@ -define(FIELDS(Fs), [{?record_field, ?ATOM(F), V} || {F,V} <- Fs]). %% Literal term. --define(TERM(T), erl_parse:abstract(T, ?LINE)). +-define(TERM(T), erl_parse:abstract(T, [ + {line, ?LINE}, + {encoding, fun diameter_codegen:is_printable_ascii/1}])). diff --git a/lib/diameter/test/diameter_compiler_SUITE.erl b/lib/diameter/test/diameter_compiler_SUITE.erl index df4dde6240..08ffe5981d 100644 --- a/lib/diameter/test/diameter_compiler_SUITE.erl +++ b/lib/diameter/test/diameter_compiler_SUITE.erl @@ -120,6 +120,16 @@ {avp_has_duplicate_flag, " -", " MM"}, + {ok, + "@vendor 0", + "@vendor 10415"}, + {ok, + [{"@vendor 0", "@vendor 10415"}, + {"Proxy-Info .*M$", "&V"}, + {"Proxy-Info ::= [^>]*", "& 10415 "}]}, + {grouped_vendor_id_without_flag, + [{"@vendor 0", "@vendor 10415"}, + {"Proxy-Info ::= [^>]*", "& 10415 "}]}, {avp_has_vendor_id, "@avp_types", "@avp_vendor_id 667 Class\n&"}, |