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
27362736 end
27372737 end
27382738
2739- defp codepoint_byte_size ( cp ) when cp <= 0x00FF , do: 1
2739+ defp codepoint_byte_size ( cp ) when cp <= 0x007F , do: 1
27402740 defp codepoint_byte_size ( cp ) when cp <= 0x07FF , do: 2
27412741 defp codepoint_byte_size ( cp ) when cp <= 0xFFFF , do: 3
27422742 defp codepoint_byte_size ( _ ) , do: 4
Original file line number Diff line number Diff line change @@ -652,6 +652,7 @@ defmodule StringTest do
652652 assert String . slice ( "あいうえお" , - 10 .. - 15 ) == ""
653653 assert String . slice ( "hello あいうえお Unicode" , 8 .. - 1 ) == "うえお Unicode"
654654 assert String . slice ( "abc" , - 1 .. 14 ) == "c"
655+ assert String . slice ( "a·̀ͯ‿.⁀:" , 0 .. - 2 ) == "a·̀ͯ‿.⁀"
655656
656657 assert_raise FunctionClauseError , fn ->
657658 String . slice ( nil , 0 .. 1 )
You can’t perform that action at this time.
0 commit comments