spring icon indicating copy to clipboard operation
spring copied to clipboard

Fixed to do force_encoding when decoding JSON.

Open masato-hi opened this issue 10 months ago • 0 comments

What I did.

Encode variables to UTF-8 when decoding JSON. Ruby's ENV variable is ASCII-8BIT, so force_encoding is required when accepting values passed via ENV.

What I didn't do.

Unicode Escape when encoding. I didn't do this because the decoding process only supports Unicode up to 4 bytes.

Related.

https://github.com/rails/spring/issues/735

https://github.com/rails/spring/commit/1ed51d04754d782d70398c75000d2d23877326e9#diff-c105c6f17eabaabdafb33fb6b9dccbaaf06e70daba153d42e3e72741a7ff6eccL16

masato-hi avatar Mar 24 '25 05:03 masato-hi