Skip to content

problems with encodings #10

@vsespb

Description

@vsespb
  1. I had crashes at this line
message = message.gsub(/^/, @@line_prefix) if @@verbose

because @@line_prefix was in 'UTF-8' and message was in 'US-ASCII'

only ruby 1.9.3.p0 affected - 1.9.3.p194 is OK.

I was able to fix it by adding something like

message.force_encoding("BINARY") if message.respond_to?(:force_encoding) && message.encoding.name != 'UTF-8'

before

message = message.gsub(/^/, @@line_prefix) if @@verbose
@@verbose = Rails.env == "development"

are you sure that checking rails env name in gem is a good idea ? It was pretty hard for me to find why I have two identical environments with same settings and only one of them is crashing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions