summaryrefslogtreecommitdiff
path: root/io_buffer.c
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2021-12-20 12:17:38 +1300
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2021-12-21 12:25:42 +1300
commitda46b8d8e5d09f896fb1af5dabea12820f02b3d6 (patch)
tree622b55ab5b16d87d88d98cc1fb21a5d14f4e3b26 /io_buffer.c
parentc3d8d26ad744d2a2dada135196e7d694d2966008 (diff)
Default `IO::Buffer#get_string` to use BINARY encoding.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5303
Diffstat (limited to 'io_buffer.c')
-rw-r--r--io_buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_buffer.c b/io_buffer.c
index 075a9bfb78..63f5bd2c24 100644
--- a/io_buffer.c
+++ b/io_buffer.c
@@ -1125,7 +1125,7 @@ io_buffer_get_string(int argc, VALUE *argv, VALUE self)
size_t offset = 0;
size_t length = data->size;
- rb_encoding *encoding = NULL;
+ rb_encoding *encoding = rb_ascii8bit_encoding();
if (argc >= 1) {
offset = NUM2SIZET(argv[0]);