search for: set_charset

Displaying 20 results from an estimated 27 matches for "set_charset".

2006 Jan 30
5
a RJS problem/patch
Hi, add_rjs_to_action_view.rb of javascript_generator_templates doesn''t work with setting Content-Type in a controller. (e.g.) http://wiki.rubyonrails.org/rails/pages/HowtoSetDefaultEncoding class ApplicationController < ActionController::Base before_filter :set_charset def set_charset @headers["Content-Type"] = "text/html; charset=utf-8" end end I think it''s better to set it forcely. --- add_rjs_to_action_view.rb.old 2006-01-31 01:42:59.000000000 +0900 +++ add_rjs_to_action_view.rb 2006-01-31 01:43:29.000000000 +09...
2007 Feb 28
1
One page in app keeps rendering as text/plain
...xt/plain] [ <=> ] 23,615 --.--K/s 10:52:10 ( 15.75 MB/s) - `registration'' saved [23615] I''ve even set an after_filter in application.rb to force the header type like so: after_filter :set_charset def set_charset @headers["Content-Type"] = "text/html; charset=utf-8" end All of my other pages render just fine ... but this is the only one I use a little RJS with. Is that related? And any idea on the '' #<#<Class: 0x2a96d0b978>:0x2a96d0b928>Co...
2006 May 08
2
How to set the default language in GetText?
...t the default language in GetText? The default language of GetText is en,and I want to change it to another language,and also keep the ability to change to any other languages by just click the according href. Currently I use: class ApplicationController < ActionController::Base before_filter :set_charset def set_charset @headers["Content-Type"] = "text/html; charset=utf-8" cookies["lang"] = ''zh_CN'' end end But the language will not switch to my want until the next refresh.Could I set the default language from en to others in some way? Th...
2006 Jan 26
2
Newbe Question: Character Encoding
I have to present german umlaute as "?" on my webpage. When writing the text within the view, everything is fine - the characters are presented correctly. When I declare variable within the controller (e.g. via flash or as a list of values for a listbox) the text is displayed with the umlaute replaced by strange characters. I assume I have to adjust the character encoding somewhere.
2006 May 09
4
Ajax calls and characters encoding (accents)
Hello, my application controller defines before_filter :set_charset def set_charset @headers["Content-Type"] = "text/html; charset=ISO-8859-1" end Everything is fine and accents are rendered correctly in the browser. However, when I call a controller/action from Ajax (Prototype), the charset is not taken in account and accents are garbage...
2006 Feb 25
5
Setting character encoding - do I do it with Rails or lighttpd?
I have a page which validates "tentatively," because the validator uses the default character encoding. None was specified apparently, so it falls back to UTF-8. How and where do I specify the character encoding? Pat
2006 Mar 05
5
special characters?
I''m not sure if this is something in Rails or MySQL, but characters like ? are showing up funky in my app. I see ''?'' in the DB using a query browser, but in the app it shows up as ''A1/4.'' Do I need to use another charset or something? -- Posted via http://www.ruby-forum.com/.
2006 Sep 19
9
Very strange: Umlauts (äöü) aren't displayed correctly in
Hi all Take a look at the following video, please... I just'' can''t help me anymore... http://josh.ch/files/temp/rails_problem.mov I''m sorry for the bad quality, it''s just a demo of Snapz Pro X 2... ;-) But I hope you''ll see enought... Thanks for any help. Josh -- Posted via http://www.ruby-forum.com/.
2006 Nov 04
0
headers[''Content-Type''] & link_to_remote on Rails Edge
...calls via link_to_remote. When I inspect headers, I see the ''Content-Type'' is key for an object rather than a string. Shouldn''t it be a string? Anyone know if this is a bug or if I''m dealing with this incorrectly. Thanks, Jamie The code: after_filter :set_charset def set_charset logger.debug("!!!!---- headers: #{headers.inspect}") unless headers[''Content-Type''] =~ /charset/i headers[''Content-Type''] ||= "text/html" headers[''Content-Type''] += ''; chars...
2007 Jan 18
4
Problem with encoding - characters such as öäü
Hi I''m trying to use german characters on a ruby on rails application, but for get ? on dropwdown menus. The database, tables and fields are encoded utf8_general_ci. I have this in my application controller: class ApplicationController < ActionController::Base before_filter :set_charset before_filter :configure_charsets def set_charset @headers["Content-Type"] = "text/html; charset=utf-8" end def configure_charsets @response.headers["Content-Type"] = "text/html; charset=utf-8" end end This in my environment.rb: ActiveRecord::Base.connec...
2006 Mar 22
9
Display problem
hey guys, Does anyone know why the french letter "?" is displayed as a question mark "?" inside an <h1> tag ? -- Posted via http://www.ruby-forum.com/.
2016 Jan 08
0
yum-cron / email sending problem
...n", line 227, in sendMessages msg = MIMEText(''.join(self.output)) File "/usr/lib64/python2.7/email/mime/text.py", line 30, in __init__ self.set_payload(_text, _charset) File "/usr/lib64/python2.7/email/message.py", line 226, in set_payload self.set_charset(charset) File "/usr/lib64/python2.7/email/message.py", line 262, in set_charset self._payload = self._payload.encode(charset.output_charset) UnicodeEncodeError: 'ascii' codec can't encode characters in position 209-210: ordinal not in range(128) whats happend please?
2006 Apr 15
0
[maybe ot] Special Characters in DB Fields
...te: straight quotes shown here are really apostrophes] In fact, it renders properly when served up from the Linux box (Safari client). Served up from the OSX box, it doesn''t. All encoding is utf-8, database, page, everything. I even have the following in application.rb: before_filter :set_charset # ... stuff ... private def set_charset @headers["Content-Type"] = "text/html; charset=utf-8" end Questions: Has anyone had this problem (or the related black diamond with a question mark); and is there a known cause/fix? Thanks -- View this message in context:...
2007 Jul 30
0
Rails/MSSQL error
...9;Expense '', ''20070730 13:57:25'') I have done all of the thing needed that makes rails support for unicode, like installing the unicode_0.1 gem, adding the $KCODE = ''u'' in the environment.rb and in the ApllicationController I have added: before_filter :set_charset def set_charset @headers["Content-Type"] = "text/html; charset=utf-8" suppress(ActiveRecord::StatementInvalid) do ActiveRecord::Base.connection.execute ''SET NAMES UTF8'' end end Also I have put encoding: utf8 in my database.yml But still...
2006 Feb 05
2
working with rails and unicode
...9;'jcode'' admin.rhtml: <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /> database.yml: development: adapter: mysql encoding: utf8 application.rb: class ApplicationController < ActionController::Base before_filter :set_charset after_filter :fix_unicode_for_safari def set_charset @headers["Content-Type"] = "text/html; charset=utf-8" end # automatically and transparently fixes utf-8 bug # with Safari when using xmlhttp def fix_unicode_for_safari if @headers["Content-Type"...
2006 Apr 11
8
Does Rails provide solid support for UTF-8?
I need to use UTF-8 in my app and was wondering if Rails would support it properly. Some sites seem to be saying that it has weak internationalization support. Is this true? If so, where is the problem? What should I look out for? Are there tweaks, plugins or gems that fix the problem? TIA. David -- Posted via http://www.ruby-forum.com/.
2006 Mar 10
7
Problem saving data in different languages
Hi, I currently have a site that lets people enter info and submit it to the database. But the problem is the it lets people enter data in their language (portuguese and spanish) and all the special characters for those languages get replaced by symbols. Any idea how would I fix that? Thanks a lot. -- Posted via http://www.ruby-forum.com/.
2006 Apr 19
5
Swedish characters problem
Hello, I''m playing around with Rails and I''m having problems with displaying swedish characters. This is how far I''ve gotten: I have a controller... class MiscController < ApplicationController def swedish_chars @chars_to_display = ''???'' end end ...and a template (swedish_chars.rhtml) <head> <title>Test with swedish
2006 Jul 18
9
Displaying HTML pulled directly from a database
How can I get RoR to display html pulled directly from a database, without converting the tags. (e.g. if "<h1>Hello</h1>" is stored (as text) in a database, how can I get RoR NOT to corvert it to "&lt;h1&gt;Hello</h1>", but instead to just pass the tags along so that "Hello" displays in bold. I''m sure it''s just a
2009 May 20
8
ctionView::TemplateError (undefined method `start_form_tag'
I upgrade my version of ruby on rails And my SO Free BSD was working with Ruby 1.8 + 1.2.6 and now Mandriva Linux with Ruby 1.8 + Rails 2.1.1 it''s not working ERROR: Processing LoginController#fazer_login (for 192.168.3.210 at 2009-05-20 09:20:53) [GET] Session ID: BAh7BzoNYWRtaW5faWQwIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpG