Skip to content

Non-ASCII character escape sequence in string_content results in SyntaxError #360

@plentz

Description

@plentz

First of all, calm down guys, this is a pre-1.7 bug(?), I just forgot to report it. it happens when using delocalize gem.

this is the code that causes the error

  Time.parse_localized "201101011200"

the output is something like this:

  1) Order from_sync imports order from mobile data
     Failure/Error: Order.apply sync_data, :on => order
     RegexpError:
       invalid multibyte character: /Março/
     # ./app/models/xpto.rb:86:in `extract_datetime'

Probably the invalid multibyte character error is caused by a string contains the pt-br translation for march, 'março'

With MRI 1.9.x it works. Putting # encoding: utf-8 in the top of the file solves the problem.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions