# Automatische Kodierung der geparsten URL-Parameter

**URL:** <https://meta.discourse.org/t/automatic-encoding-of-parsed-url-params/67232>\
**Category:** Development\
**Created:** [1. August 2017 um 09:53 UTC](https://meta.discourse.org/t/automatic-encoding-of-parsed-url-params/67232 "2017-08-01T09:53:48Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)\
**Post date:** [1. August 2017 um 09:53 UTC](https://meta.discourse.org/t/automatic-encoding-of-parsed-url-params/67232/1 "2017-08-01T09:53:49Z")

</div>

The underlying problem which caused [this bug](https://meta.discourse.org/t/tags-does-not-work-with-cyrillic/67217) is that query parameters, at least, are not being tagged with any particular encoding. Based on some reading, it’s my understanding that modern Rails versions _do_ correctly indicate the encoding of parameters provided in request bodies (by looking at the `Content-Type` request header), and experimentation indicates that explicit query parameters (such as `?foo=bar`) _do_ get marked as being UTF-8, but as far as I can tell params which come from parsing the URL through route patterns, and format markers, are being marked as `ASCII-8BIT`.

I’ve played a bit of whack-a-mole with the problems reported in the bug topic above, but given that we found three separate instances of potentially needing to force an encoding in one place, I’m thinking the issue is fairly likely to be _extremely_ widespread throughout the codebase.

So, the questions which come to mind are:

- Does this constitute a bug in Rails itself which should be fixed?
- How should this be worked around in Discourse, either until Rails itself gets fixed, or forever?
- How has this not been a problem before? It’s not like Discourse suddenly got its first non-seven-bit-ASCII users in the last week or two…

---

_[View the full topic](https://meta.discourse.org/t/automatic-encoding-of-parsed-url-params/67232)._
