@@ -21,7 +21,7 @@ defmodule String.Unicode do
2121 _bidi_mirror , _unicode_1 , _iso ,
2222 upper , lower , title ] = :binary . split ( line , ";" , [ :global ] )
2323
24- title = :binary . part ( title , 0 , size ( title ) - 1 )
24+ title = :binary . part ( title , 0 , byte_size ( title ) - 1 )
2525
2626 cond do
2727 upper != "" or lower != "" or title != "" ->
@@ -215,35 +215,35 @@ defmodule String.Graphemes do
215215 # Break on control
216216 for codepoint <- cluster [ "CR" ] ++ cluster [ "LF" ] ++ cluster [ "Control" ] do
217217 def next_grapheme ( << unquote ( codepoint ) , rest :: binary >> = string ) do
218- { :binary . part ( string , 0 , unquote ( size ( codepoint ) ) ) , rest }
218+ { :binary . part ( string , 0 , unquote ( byte_size ( codepoint ) ) ) , rest }
219219 end
220220 end
221221
222222 # Break on Prepend*
223223 # for codepoint <- cluster["Prepend"] do
224224 # def next_grapheme(<< unquote(codepoint), rest :: binary >> = string) do
225- # next_prepend(rest, string, unquote(size (codepoint)))
225+ # next_prepend(rest, string, unquote(byte_size (codepoint)))
226226 # end
227227 # end
228228
229229 # Handle Hangul L
230230 for codepoint <- cluster [ "L" ] do
231231 def next_grapheme ( << unquote ( codepoint ) , rest :: binary >> = string ) do
232- next_hangul_l ( rest , string , unquote ( size ( codepoint ) ) )
232+ next_hangul_l ( rest , string , unquote ( byte_size ( codepoint ) ) )
233233 end
234234 end
235235
236236 # Handle Hangul T
237237 for codepoint <- cluster [ "T" ] do
238238 def next_grapheme ( << unquote ( codepoint ) , rest :: binary >> = string ) do
239- next_hangul_t ( rest , string , unquote ( size ( codepoint ) ) )
239+ next_hangul_t ( rest , string , unquote ( byte_size ( codepoint ) ) )
240240 end
241241 end
242242
243243 # Handle Regional
244244 for codepoint <- cluster [ "Regional_Indicator" ] do
245245 def next_grapheme ( << unquote ( codepoint ) , rest :: binary >> = string ) do
246- next_regional ( rest , string , unquote ( size ( codepoint ) ) )
246+ next_regional ( rest , string , unquote ( byte_size ( codepoint ) ) )
247247 end
248248 end
249249
@@ -263,19 +263,19 @@ defmodule String.Graphemes do
263263 # Handle Hangul L
264264 for codepoint <- cluster [ "L" ] do
265265 defp next_hangul_l ( << unquote ( codepoint ) , rest :: binary >> , string , size ) do
266- next_hangul_l ( rest , string , size + unquote ( size ( codepoint ) ) )
266+ next_hangul_l ( rest , string , size + unquote ( byte_size ( codepoint ) ) )
267267 end
268268 end
269269
270270 for codepoint <- cluster [ "LV" ] do
271271 defp next_hangul_l ( << unquote ( codepoint ) , rest :: binary >> , string , size ) do
272- next_hangul_v ( rest , string , size + unquote ( size ( codepoint ) ) )
272+ next_hangul_v ( rest , string , size + unquote ( byte_size ( codepoint ) ) )
273273 end
274274 end
275275
276276 for codepoint <- cluster [ "LVT" ] do
277277 defp next_hangul_l ( << unquote ( codepoint ) , rest :: binary >> , string , size ) do
278- next_hangul_t ( rest , string , size + unquote ( size ( codepoint ) ) )
278+ next_hangul_t ( rest , string , size + unquote ( byte_size ( codepoint ) ) )
279279 end
280280 end
281281
@@ -286,7 +286,7 @@ defmodule String.Graphemes do
286286 # Handle Hangul V
287287 for codepoint <- cluster [ "V" ] do
288288 defp next_hangul_v ( << unquote ( codepoint ) , rest :: binary >> , string , size ) do
289- next_hangul_v ( rest , string , size + unquote ( size ( codepoint ) ) )
289+ next_hangul_v ( rest , string , size + unquote ( byte_size ( codepoint ) ) )
290290 end
291291 end
292292
@@ -297,7 +297,7 @@ defmodule String.Graphemes do
297297 # Handle Hangul T
298298 for codepoint <- cluster [ "T" ] do
299299 defp next_hangul_t ( << unquote ( codepoint ) , rest :: binary >> , string , size ) do
300- next_hangul_t ( rest , string , size + unquote ( size ( codepoint ) ) )
300+ next_hangul_t ( rest , string , size + unquote ( byte_size ( codepoint ) ) )
301301 end
302302 end
303303
@@ -308,7 +308,7 @@ defmodule String.Graphemes do
308308 # Handle regional
309309 for codepoint <- cluster [ "Regional_Indicator" ] do
310310 defp next_regional ( << unquote ( codepoint ) , rest :: binary >> , string , size ) do
311- next_regional ( rest , string , size + unquote ( size ( codepoint ) ) )
311+ next_regional ( rest , string , size + unquote ( byte_size ( codepoint ) ) )
312312 end
313313 end
314314
@@ -319,7 +319,7 @@ defmodule String.Graphemes do
319319 # Handle Extend+SpacingMark
320320 for codepoint <- cluster [ "Extend" ] ++ cluster [ "SpacingMark" ] do
321321 defp next_extend ( << unquote ( codepoint ) , rest :: binary >> , string , size ) do
322- next_extend ( rest , string , size + unquote ( size ( codepoint ) ) )
322+ next_extend ( rest , string , size + unquote ( byte_size ( codepoint ) ) )
323323 end
324324 end
325325
@@ -330,7 +330,7 @@ defmodule String.Graphemes do
330330 # Handle Prepend
331331 # for codepoint <- cluster["Prepend"] do
332332 # defp next_prepend(<< unquote(codepoint), rest :: binary >>, string, size) do
333- # next_prepend(rest, string, size + unquote(size (codepoint)))
333+ # next_prepend(rest, string, size + unquote(byte_size (codepoint)))
334334 # end
335335 # end
336336 #
0 commit comments