Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6767319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:56:13+00:00 2026-05-26T14:56:13+00:00

I know this is the most common problem in the history of programming but

  • 0

I know this is the most common problem in the history of programming but I reallu believe I have tried it all now but I still get: incompatible character encodings: UTF-8 and ASCII-8BIT in my pages#index.html file.

I am running Ruby 1.9.2 and Rails 3.1.1.

This is what I have verified / tested / set:

  • In database.yml, set encoding: utf8

    development:
    adapter: mysql
    encoding: utf8
    reconnect: false
    database: kopa_development
    pool: 5
    username: root
    password:
    host: localhost

  • Checked with Notepad++ that the textfile(s) in term is encoded to utf-8

  • Checked with mysql query browser that the database is set to utf-8, so are the columns
  • I have tried with # coding: utf-8 in the controller related to the view I am trying to look at.
  • I have put SET NAMES utf8 in mysql
  • I have tried Encoding.default_internal = Encoding::UTF_8 in environment.rb as well as Encoding.default_external = Encoding::UTF_8
  • I have config.encoding = “utf-8” in application.rb
  • I have Googled
  • I have read http://www.joelonsoftware.com/articles/Unicode.html
  • I have tried both Notepad++ and RubyMine
  • Adding .force_encoding works but is very inconvenient to do

A funny thing is that if I set the index.html.erb to ANSI it will complain that application.html.erb does not have the correct encoding (rather than index.html.erb). I don’t know what this means but it makes me think that there is something fishy with the editor.

I remember when using e text editor that there were two things I could set (with reference to encoding) the encoding and something else. That “else” I don’t remember what it was though and I don’t have e anymore.

Regarding the error-message, do I understand it correctly that the first mentioned means the database encoding and the second the Rails(?) encoding? I have seen the opposite error message as well (ASCII first and UTF-8 after).

Edit: I Googled some more this morning and found there is something wrong with the mysql-gem. The articles were a bit old and I tried the solutions there (such as trying mysql2 & ruby-mysql) with no better luck.

I am all out of ideas. How about you?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:56:14+00:00Added an answer on May 26, 2026 at 2:56 pm

    I couldn’t fix this problem. I “solved” it by purchasing a Mac and continue to develop my Rails apps on it instead…

    Encoding – me: 1-0

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is most-likely a simple question but when you restore a database
I know that this kind of issue is most discussed. But I would like
I'd like to know the most efficient SQL query for achieving this problem: Say
I know this is largely an opinion, but I'm interested if you have one
I don't know if that's a common problem. Most of the times that we
I'm sure this is a common problem, I don't know if there is a
Sorry I know similar question have been asked many times before but like most
This isn't a show-stopping programming problem as such, but perhaps more of a design
I know I can use this way to find the most frequent element in
To preface this, the most I know about text encoding I learned from Joel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.