TIMEX
TIMEX

Reputation: 271774

Wrong encoding of text, in Django?

"query" = джазовыми

For some reason...when I display it via:

{{ query|safe }}

I get this:

%u0434%u0436%u0430%u0437%u043E%u0432%u044B%u043C%u0438

Upvotes: 0

Views: 306

Answers (1)

Antony Hatchkins
Antony Hatchkins

Reputation: 33984

Would the query be set from the source, this would solve it:

query = u"джазовыми"

(provided that for example your file encoding is utf-8 and you have corresponding line

# -*- coding: UTF-8 -*-

in the beginning)

But I guess the query is entered by user. The error seems to be located in that part of your code. Can you quote how it is done?

Upvotes: 2

Related Questions