By o88o
I have an Ubuntu 18.04 server with Nginx and Phusion Passenger (non-Rails app) and it is working for websites with ASCII characters in HTML only.
But when I put a non-ascii character to the index.erb like á for example, I get error:
Incomplete response received from application
My locale is:
LANG=C.UTF-8
LANGUAGE=C.UTF-8
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=C.UTF-8
All files are in UTF-8 as well, of course.
Any ideas? I’m out of mine already…
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
It seems like your environment is set up correctly for handling UTF-8 characters, so the issue might lie elsewhere. Here are a few things to check:
File Encoding: You’ve mentioned your files are in UTF-8, but it’s worth double checking. You can use a command like file -i filename to check the encoding of a specific file. The output should include charset=utf-8 if the file is indeed UTF-8 encoded.
ERB Template Encoding: Ensure that Ruby is aware that your ERB templates are in UTF-8. At the top of your ERB file, you can add a magic comment to specify the encoding:
# encoding: UTF-8
HTTP Headers: Check your HTTP headers to make sure that the Content-Type header specifies a UTF-8 charset, like so: Content-Type: text/html; charset=UTF-8. You can set this in your Nginx configuration file.
Database Encoding: If you’re pulling any data from a database, ensure that the database and its tables are set to use a UTF-8 compatible character set.
Application Encoding Settings: Depending on the language your application is written in, there may be additional settings to control the default encoding. For example, in Ruby you can set Encoding.default_external = Encoding::UTF_8.
If none of these seem to solve the issue, the problem might lie in the specific code of your application. You might have to trace the application’s execution to see where the response is being cut off or incorrectly encoded.
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.