dry-rb/dry-files

Unable to to create files in binmode.

Open

#19 opened on Nov 14, 2023

 (0 comments) (0 reactions) (0 assignees)Ruby (8 forks)github user discovery
bughelp wanted

Repository metrics

Stars
 (40 stars)
PR merge metrics
 (Avg merge 57d) (1 merged PR in 30d)

Description

Describe the bug

Unable to write binary files. Got Encoding::UndefinedConversionError: "\x89" from ASCII-8BIT to UTF-8 error.

To Reproduce

Dry::Files.new.write(
  "image.png",
  result[:io].force_encoding(Encoding::BINARY)
)

Expected behavior

Works as File.binwrite()

Contributor guide