[#81999] [Ruby trunk Bug#13737] "can't modify frozen String" when installing bundled gems — ko1@...
Issue #13737 has been updated by ko1 (Koichi Sasada).
4 messages
2017/07/11
[#82005] [Ruby trunk Bug#13737] "can't modify frozen String" when installing bundled gems — nobu@...
Issue #13737 has been updated by nobu (Nobuyoshi Nakada).
3 messages
2017/07/12
[#82102] Re: register_fstring_tainted:FL_TEST_RAW(str, RSTRING_FSTR) — Eric Wong <normalperson@...>
Koichi Sasada <ko1@atdot.net> wrote:
4 messages
2017/07/18
[#82151] [Ruby trunk Feature#13637] [PATCH] tool/runruby.rb: test with smallest possible machine stack — Rei.Odaira@...
Issue #13637 has been updated by ReiOdaira (Rei Odaira).
3 messages
2017/07/24
[ruby-core:82009] [Ruby trunk Bug#13738] Active Scaffold image upload using CarrierWave gem
From:
duerst@...
Date:
2017-07-12 10:29:01 UTC
List:
ruby-core #82009
Issue #13738 has been updated by duerst (Martin D端rst).
karanamsandhya (Karanam Sandhya) wrote:
> getting Encoding::UndefinedConversionError ("\xFF" from ASCII-8BIT to UTF-8): this error while uploding the image.
There's definitely no error in Ruby itself, in the encoding "ASCII-8BIT", only the lower half is convertible; the upper half is okay in the source, but undefined and so not convertible to any other encoding.
I don't know the CarrierWave gem. But if they are trying to convert image data (which very easily can contain a 0xFF byte, and for which a String with an encoding of ASCII-8BIT (alias: BINARY) is appropriate) to UTF-8, then they are definitely making a mistake. If the error happens for some other data (e.g. for some text data extracted from an image header), then I can understand that such an error happens. If the image format actually defines what encoding to use for the text, then String#force_encoding should be applied first. If not, I'd suggest to change the conversion from something like
```
string_with_unknown_encoding_labeled_as_ascii_8bit.encode('UTF-8')
```
to something like
```
string_with_unknown_encoding_labeled_as_ascii_8bit.encode('UTF-8', invalid: :replace)
```
which will convert 0xFF bytes (and similar) to '?'.
----------------------------------------
Bug #13738: Active Scaffold image upload using CarrierWave gem
https://bugs.ruby-lang.org/issues/13738#change-65740
* Author: karanamsandhya (Karanam Sandhya)
* Status: Third Party's Issue
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: 2.3.1
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
getting Encoding::UndefinedConversionError ("\xFF" from ASCII-8BIT to UTF-8): this error while uploding the image. and image params are like this:
"photo"=>#<ActionDispatch::Http::UploadedFile:0x007fbcc2925c80 @tempfile=#<Tempfile:/tmp/RackMultipart20170712-7555-c67kvs.jpg>, @original_filename="1.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"record[photo]\"; filename=\"1.jpg\"\r\nContent-Type: image/jpeg\r\n">
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>