Skip to content

Commit

Permalink
FIX: deline/lines and read/lines misinterprets UTF-8 character as…
Browse files Browse the repository at this point in the history
… newline

fixes: Oldes/Rebol-issues#1794
  • Loading branch information
Oldes committed Jun 19, 2020
1 parent 69b36b8 commit 5e32c54
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/s-ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ static REBYTE seed_str[SEED_LEN] = {
REBCNT idx = VAL_INDEX(val);
REBCNT start = idx;
REBSER *out;
REBCHR c;
REBUNI c; // don't use REBCHR!!! it is only for OS strings! see issue#1794

BLK_RESET(ser);

Expand Down
3 changes: 3 additions & 0 deletions src/tests/units/port-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ Rebol [
--assert ["a" ""] = read/lines %tmp.txt
delete %tmp.txt

--test-- "read/lines - issue/1794"
--assert 1 = length? read/lines %units/files/issue-1794.txt

--test-- "write file result - wish/2337"
;@@ https://github.com/Oldes/Rebol-issues/issues/2337
--assert file? write %foo "hello"
Expand Down
10 changes: 10 additions & 0 deletions src/tests/units/series-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,16 @@ Rebol [

===end-group===


===start-group=== "DELINE / ENLINE"

--test-- "deline/lines issue 1794"
;@@ https://github.com/Oldes/Rebol-issues/issues/1794
--assert 1 = length? deline/lines "Slovenščina"

===end-group===


===start-group=== "AS coercion"

--test-- "AS datatype! any-string!"
Expand Down

0 comments on commit 5e32c54

Please sign in to comment.