Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add "# coding: utf-8" to all files

Can I somehow configure Rails to avoid the need to add # coding: utf-8 to all files? Or must I add it to each file manually?

UPD

To improve my life I have found this gem:

magic_encoding

It won't fix the problem, but it will add magick line to each file. Related topic: Why are all strings ASCII-8BIT after I upgraded to Rails 3?

like image 571
fl00r Avatar asked Aug 12 '11 07:08

fl00r


People also ask

Is ADD different from ADHD?

ADHD is the official, medical term for the condition — regardless of whether a patient demonstrates symptoms of hyperactivity. ADD is a now-outdated term that is typically used to describe inattentive-type ADHD, which has symptoms including disorganization, lack of focus, and forgetfulness.

What is ADD behavior?

ADD is the term commonly used to describe symptoms of inattention, distractibility, and poor working memory. ADHD is the term used to describe additional symptoms of hyperactivity and impulsivity. Both are included in the medical diagnosis of attention deficit hyperactivity disorder.


1 Answers

In a rails application you can specify the default chracter encoding in your application config.

Add the following code inside the Application class in in config/application.rb

Looks something like:

# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
like image 167
Mario Visic Avatar answered Sep 30 '22 07:09

Mario Visic