Skip to content

Commit 58a0ee0

Browse files
committed
check filenames are utf-8 when doing list_dir in erlang
1 parent 68ce23c commit 58a0ee0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44

5+
## v1.5.1 - 22 March 2024
6+
- use unicode module to convert filenames to utf8 on erlang
7+
58
## v1.5.0 - 29 February 2024
69
- add `file_info` function.
710

gleam.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "simplifile"
2-
version = "1.5.0"
2+
version = "1.5.1"
33
description = "Basic file operations that work on all targets"
44

55
licences = ["Apache-2.0"]

src/simplifile_erl.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ make_directory(Dir) ->
9999
list_directory(Dir) ->
100100
case file:list_dir(Dir) of
101101
{ok, Filenames} ->
102-
{ok, [list_to_binary(Filename) || Filename <- Filenames]};
102+
{ok, [unicode:characters_to_binary(Filename) || Filename <- Filenames]};
103103
{error, Reason} when ?is_posix_error(Reason) ->
104104
{error, Reason}
105105
end.

0 commit comments

Comments
 (0)