File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -2736,7 +2736,7 @@ defmodule String do
2736
2736
end
2737
2737
end
2738
2738
2739
- defp codepoint_byte_size ( cp ) when cp <= 0x00FF , do: 1
2739
+ defp codepoint_byte_size ( cp ) when cp <= 0x007F , do: 1
2740
2740
defp codepoint_byte_size ( cp ) when cp <= 0x07FF , do: 2
2741
2741
defp codepoint_byte_size ( cp ) when cp <= 0xFFFF , do: 3
2742
2742
defp codepoint_byte_size ( _ ) , do: 4
Original file line number Diff line number Diff line change @@ -652,6 +652,7 @@ defmodule StringTest do
652
652
assert String . slice ( "あいうえお" , - 10 .. - 15 ) == ""
653
653
assert String . slice ( "hello あいうえお Unicode" , 8 .. - 1 ) == "うえお Unicode"
654
654
assert String . slice ( "abc" , - 1 .. 14 ) == "c"
655
+ assert String . slice ( "a·̀ͯ‿.⁀:" , 0 .. - 2 ) == "a·̀ͯ‿.⁀"
655
656
656
657
assert_raise FunctionClauseError , fn ->
657
658
String . slice ( nil , 0 .. 1 )
You can’t perform that action at this time.
0 commit comments