Skip to content

Why are route parameters encoded as "ASCII-8BIT"? #1362

@sinclairtarget

Description

@sinclairtarget

Using Ruby 2.4.1 and Sinatra 2.0.0.

Using the following get invocation:

get '/entries/:slug' do |slug|
  logger.info slug.encoding
end

Making a GET request to /entries/foo will log the encoding as ASCII-8BIT.

Why is the encoding not UTF-8? This plays havoc with sqlite3 at the very least, which interprets ASCII-8BIT strings as BLOB data instead of string data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions