This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 118438 - Examine Rails charset to determine what NetBeans should use
Summary: Examine Rails charset to determine what NetBeans should use
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Rails (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@ruby
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-10 20:24 UTC by Torbjorn Norbye
Modified: 2011-01-28 20:11 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Torbjorn Norbye 2007-10-10 20:24:57 UTC
See the following discussion from dev@ruby:
http://www.nabble.com/Re%3A-UTF-8-by-default--p12908763s27020.html
We should investigate this and so something smarter about default encoding for rails projects, especially with Rails 1.2.


Post:
Thanks a lot for the tip, Tor, I see the option on project properties now (sorry for my lack of knowledge on that).
Setting it on a project basis should solve my problems.

AFAIK, since Rails 1.2 unicode (or at least UTF-8) is fully supported (they have created some ruby classes do deal with
it properly). It is the default charset for ActionController when you create a new project (look at
/rails/actionpack/lib/action_controller/base.rb, around line 300 - @@default_charset = "utf-8"). That makes special
characters be rendered wrong if the webpages are written in ANSI or else. 

So, users creating a new rails project in Netbeans would have problems with accents in their pages, unless they change
their master/project config in Netbeans to be UTF-8. Perhaps you could tie the encoding used in Netbeans Rails projects
to whatever Rails is using, and if the user changed this config in Project Properties you could change his
environment.rb to reflect that (or at least warn him). You could figure out Rails encoding with a rake task such as:

desc "Encoding for Action Controller" 
task :encoding => :environment do
  puts ActionController::Base.default_charset
end

And set it adding the following line in the project's config/environment.rb: 
ActionController::Base.default_charset= "UTF-8"
Sorry for keeping you guys busy with that, keep up the excellent work!

Cheers,

Bernardo
Comment 1 Torbjorn Norbye 2007-10-30 23:54:51 UTC
It's a good idea but will have to wait until the next release.