Skip to content

Commit f3b8708

Browse files
committed
Split on \r\n and \n accordingly during unicode compilation, closes #10991
1 parent faa2f35 commit f3b8708

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/elixir/unicode/properties.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ defmodule String.Casing do
138138
codes =
139139
special_path
140140
|> File.read!()
141-
|> String.split("\n", trim: true)
141+
|> String.split(["\r\n", "\n"], trim: true)
142142
|> Enum.reduce(codes, fn
143143
"", acc ->
144144
acc
@@ -325,7 +325,7 @@ defmodule String.Break do
325325
whitespace =
326326
prop_path
327327
|> File.read!()
328-
|> String.split("\n")
328+
|> String.split(["\r\n", "\n"])
329329
|> Enum.reduce([], fn line, acc ->
330330
case :binary.split(line, ";") do
331331
[<<first::4-bytes, "..", last::4-bytes, _::binary>>, <<" White_Space", _::binary>>] ->

lib/elixir/unicode/tokenizer.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ defmodule String.Tokenizer do
4747
{start, continue, patterns} =
4848
prop_path
4949
|> File.read!()
50-
|> String.split("\n", trim: true)
50+
|> String.split(["\r\n", "\n"], trim: true)
5151
|> Enum.reduce({start, continue, []}, fn line, acc ->
5252
[codepoints | category] = :binary.split(line, ";")
5353

0 commit comments

Comments
 (0)