nesta icon indicating copy to clipboard operation
nesta copied to clipboard

It is impossible to use cyrillic or other UTF-8 symbols in articles and headers

Open k2m30 opened this issue 10 years ago • 1 comments

invalid byte sequence in US-ASCII (Argument Error), models.rb:163

I made changes in Gemfile, as suggested here

Encoding.default_external = Encoding::UTF_8 Encoding.default_internal = Encoding::UTF_8

Also I changed Google Font link accordingly to make it support cyrillic. And now it works perfectly.

Hope this helps.

k2m30 avatar Nov 09 '14 20:11 k2m30

Thanks for that – much appreciated.

gma avatar Nov 10 '14 06:11 gma

I'm closing this, having just taken another look at what might have been causing it. On line 163 of models.rb at this time, was this method call:

first_paragraph, remaining = contents.split(/\r?\n\r?\n/, 2)

Having read the SO thread that k2m30 posted, I'm imagining that Ruby was interpreting escape characters differently with whatever locale happened to be set on their system.

If this was a common problem I'm sure we'd have had more reports of it on this bug since then, so I'm going to close it.

I also like the approach recommended on SO of setting environment variables to modify the behaviour (i.e. no code changes required). So I'm closing it for now.

gma avatar Apr 30 '24 20:04 gma