File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -504,14 +504,14 @@ defmodule String do
504504 ## Examples
505505
506506 iex> String.normalize("yêṩ", :nfd)
507- "yêṩ "
507+ "yêṩ "
508508
509509 iex> String.normalize("leña", :nfc)
510510 "leña"
511511
512512 """
513- @ spec normalize ( t , atom ) :: boolean
514- defdelegate normalize ( binary , form ) , to: String.Normalizer
513+ @ spec normalize ( t , atom ) :: t
514+ defdelegate normalize ( string , form ) , to: String.Normalizer
515515
516516 @ doc """
517517 Converts all characters in the given string to uppercase.
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ defmodule StringTest do
333333
334334 test "normalize" do
335335 assert String . normalize ( "ŝ" , :nfd ) == "ŝ"
336- assert String . normalize ( "ḇravô" , :nfd ) == "ḇravô "
336+ assert String . normalize ( "ḇravô" , :nfd ) == "ḇravô "
337337 assert String . normalize ( "ṩierra" , :nfd ) == "ṩierra"
338338 assert String . normalize ( "뢴" , :nfd ) == "뢴"
339339 assert String . normalize ( "êchǭ" , :nfc ) == "êchǭ"
Original file line number Diff line number Diff line change @@ -505,7 +505,7 @@ defmodule String.Normalizer do
505505 { n , rest } = String.Unicode . next_grapheme_size ( binary )
506506 part = :binary . part ( binary , 0 , n )
507507 case n do
508- 1 -> normalize_nfc ( rest , acc <> part )
508+ 1 -> normalize_nfd ( rest , acc <> part )
509509 _ -> normalize_nfd ( rest , acc <> canonical_order ( part , [ ] ) )
510510 end
511511 end
You can’t perform that action at this time.
0 commit comments