search for: mb_char

Displaying 10 results from an estimated 10 matches for "mb_char".

Did you mean: mbchar
2010 Nov 10
0
Problem with case statement and mb_chars in Ruby-1.9.2
...n "common name" @my_correspondent.correspondent_common_name = s when "legal name" . . . else raise ArgumentError, "#{n} attribute is not provided for." end hll_normalize is defined as: def hll_normalise strip.squeeze(" ").mb_chars.downcase end I pass this case statement this value for n: "common name" When run with Ruby-1.8.7p302 this works. The exact same code run with Ruby-1.9.2p0 yields: common name attribute is not provided for. (ArgumentError) When I enter rails console then I see this: $ rails c Load...
2008 Dec 15
1
Unicode problem with mb_chars.index
Hello, I tried the following str ="ÄÄa__" assert str.mb_chars.is_utf8? assert str.is_utf8? # this is logical assert_equal 4, str.index("a", 4) # this is not logical. shouldn''t this be nil !? assert_equal 2, str.mb_chars.index("a", 4) Why is the last line failing? And how could I fix this? Regards, Peter. PS: I am using ruby...
2010 May 10
6
feedback on a few ActiveSupport::Multibyte patches
Hi all, In response to Rodrigo Rosas''s message about mb_chars.upcase not giving the expected result on 1.9, I''ve done some work in a fork to make String#mb_chars always return an instance of a proxy class, both with Ruby 1.8 and Ruby 1.9. The end result of the patch is (hopefully) to make Rails'' multibyte functionality behave the same way...
2010 Mar 18
1
capitalize and utf8 international symbols
...elopment environment (Rails 2.2.3) >> $KCODE => "UTF8" >> "яблоко".capitalize => "яблоко" Where "Яблоко" was expected (Russian word for "Apple"). I''ve googled for a workaround and found this: >> "яблоко".mb_chars.capitalize.to_s => "Яблоко" but does it really need to be so ugly? Everyone else doing this? I''m on Ubuntu 9.10 with Rails-2.2.3 and ruby-1.8.7. -- Cheers, Alex -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"...
2010 May 08
19
mb_chars.upcase and Ruby 1.9.2
I''m testing ruby-head through rvm but can''t get ''ação''.mb_chars.upcase == ''AÇÃO''... I get ''AçãO'' instead... This happens both for Rails 2.3.5 and Rails 3 beta 3... How can I get upcase to work correctly? Thanks in advance, Rodrigo. -- You received this message because you are subscribed to the Google Groups "Ruby...
2009 Aug 02
13
NoMethodError in User sessionsController#create - Authlogic
...c and step-by-step done everything. And almost everything works fine, except login in. After registration new user is automatically logged in, he can edit his profile, but after clicking logout and trying to login again I get error NoMethodError in User sessionsController#create undefined method `mb_chars'' for "rzepak":String My user_session_controller.rb: class UserSessionsController < ApplicationController def new @user_session = UserSession.new end def create @user_session = UserSession.new(params[:user_session]) if @user_session.save flash[:notice] = &qu...
2010 Jun 09
1
[patch] fix bytesize in exception template; multibyte titleize
...d, but bytes is needed, so it breaks with string with multibyte chars. https://rails.lighthouseapp.com/projects/8994/tickets/4727-use-rackutilsbytesize-instead-of-length-when-determining-request-content-length-for-showing-exceptions * Add AS::Multibyte::Chars#titleize This makes "café".mb_chars.titleize "do the right thing," in the sprit of a few other patches I recently submitted. https://rails.lighthouseapp.com/projects/8994/tickets/2794-titleize-missing-in-activesupportmultibytechars I realize Railsconf is going on (I''m here!) but I thought it might be good to poi...
2010 Jun 26
0
[PATCH] don't unnecessarily override methods for 1.9.2 in AS::Multibyte::Chars
HI all, A patch of mine from a few weeks ago made String#mb_chars use a proxy class for 1.9.x as well as 1.8. This proxy overrode some methods that were buggy in 1.9.1. but that work in 1.9.2. Since Rails officially now only supports 1.8.7 and 1.9.2, these methods should definitely no longer be overridden. Here''s the LH ticket: https://rails.lighthouse...
2008 Dec 04
1
permalink_fu and Rails 2.2.2
Hi, Since I have updated my Rails gems to 2.2.2, when I create a new entry in DB which has a permalink I get the following error message: uninitialized constant ActiveSupport::Multibyte::Handlers Do you know if permalink_fu is compatible with Rails 2.2.2? Is there an option I have forgotten to pass to make it work correctly? -- Posted via http://www.ruby-forum.com/.
2009 Nov 13
3
Encoding::UTF_8 missing?
...support-2.3.4/lib/active_support/multibyte/chars.rb:86:in `initialize'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/string/multibyte.rb:44:in `new'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/string/multibyte.rb:44:in `mb_chars'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:798:in `validates_uniqueness_of'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:468:in `validates_each'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/ac...