-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #618 from ferd/otp-20-unicode-support
OTP-20 unicode support and OTP-21 readiness
- Loading branch information
Showing
12 changed files
with
108 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
{"1.1.0", | ||
[{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.0.4">>},0}, | ||
{<<"cf">>,{pkg,<<"cf">>,<<"0.2.2">>},0}, | ||
{<<"erlware_commons">>,{pkg,<<"erlware_commons">>,<<"1.0.0">>},0}, | ||
{<<"getopt">>,{pkg,<<"getopt">>,<<"0.8.2">>},0}, | ||
{<<"erlware_commons">>,{pkg,<<"erlware_commons">>,<<"1.0.1">>},0}, | ||
{<<"getopt">>,{pkg,<<"getopt">>,<<"1.0.1">>},0}, | ||
{<<"providers">>,{pkg,<<"providers">>,<<"1.6.0">>},0}]}. | ||
[ | ||
{pkg_hash,[ | ||
{<<"bbmustache">>, <<"7BA94F971C5AFD7B6617918A4BB74705E36CAB36EB84B19B6A1B7EE06427AA38">>}, | ||
{<<"cf">>, <<"7F2913FFF90ABCABD0F489896CFEB0B0674F6C8DF6C10B17A83175448029896C">>}, | ||
{<<"erlware_commons">>, <<"087467DE5833C0BB5B3CCDD387F9E9C1FB816A75B7A709629BF24B5ED3246C51">>}, | ||
{<<"getopt">>, <<"B17556DB683000BA50370B16C0619DF1337E7AF7ECBF7D64FBF8D1D6BCE3109B">>}, | ||
{<<"erlware_commons">>, <<"ABC13522C826CA709173FA20DBBF7C7D00ADE914A770A1364962A1DF8FE98DE5">>}, | ||
{<<"getopt">>, <<"C73A9FA687B217F2FF79F68A3B637711BB1936E712B521D8CE466B29CBF7808A">>}, | ||
{<<"providers">>, <<"DB0E2F9043AE60C0155205FCD238D68516331D0E5146155E33D1E79DC452964A">>}]} | ||
]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
%% Compatibility module for the string API changes between | ||
%% OTP-19 and OTP-21, where Unicode support means the deprecation | ||
%% of a lot of string functions. | ||
-module(rlx_string). | ||
-export([concat/2, lexemes/2, join/2]). | ||
|
||
-ifdef(unicode_str). | ||
concat(Str1, Str2) -> unicode:characters_to_list([Str1,Str2]). | ||
lexemes(Str, Separators) -> string:lexemes(Str, Separators). | ||
-else. | ||
concat(Str1, Str2) -> string:concat(Str1, Str2). | ||
lexemes(Str, Separators) -> string:tokens(Str, Separators). | ||
-endif. | ||
|
||
%% string:join/2 copy; string:join/2 is getting obsoleted | ||
%% and replaced by lists:join/2, but lists:join/2 is too new | ||
%% for version support (only appeared in 19.0) so it cannot be | ||
%% used. Instead we just adopt join/2 locally and hope it works | ||
%% for most unicode use cases anyway. | ||
join([], Sep) when is_list(Sep) -> | ||
[]; | ||
join([H|T], Sep) -> | ||
H ++ lists:append([Sep ++ X || X <- T]). |
Oops, something went wrong.