Displaying 20 results from an estimated 1000 matches similar to: "capitalize and utf8 international symbols"
2011 Sep 14
1
Hitting 500 status code on invalid UTF-8 byte sequence in params
Hello Core,
Background: with Redmine-1.2 on Rails-2.3.11 we''re experiencing a "500
Internal Server Error" every time a mail with invalid UTF-8 byte
sequence is hitting the MailHandler (the exception comes from the DB
complaining about invalid string in the INSERT statement.)
Since we do care about internal errors we''ve installed
exception_notification plugin and this
2011 Apr 08
5
How to extend a helper using plugin?
Hello,
I''m facing this problem while trying to extend the parse_redmine_links
helper method in Redmine-1.1.0 (Rails-2.3.5) from my plugin.
My idea is to use alias_method_chain so the extended version could
call the original version and adjust the result to it''s liking.
Anything I''ve tried so far exposes this behavior: the first render of
a page uses the extended
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 1.8.6 on linux with rails
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
in 1.8.7 and 1.9.x.
2009 Aug 02
13
NoMethodError in User sessionsController#create - Authlogic
Hi,
I''m beginner in rails, and I wanted to add to my simple application
Authlogic. So I''ve watched http://railscasts.com/episodes/160-authlogic
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
2010 Nov 10
0
Problem with case statement and mb_chars in Ruby-1.9.2
RoR-3.0.1
I have this case statement:
case n.hll_normalize
when "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
2010 Jun 09
1
[patch] fix bytesize in exception template; multibyte titleize
Hi all,
I wanted to draw some attention to a couple of very small multibyte-related
patches I believe should be included before Rails 3.0 RC1:
* Use String#bytesize rather than String#length in exception templates:
This is a simple case where string length is checked, but bytes is needed,
so it breaks with string with multibyte chars.
2011 Jul 14
1
Correct behavior of Hmisc::capitalize()?
Hi,
from example(capitalize) of the Hmisc package (v 0.8.3) you get:
> capitalize(c("Hello", "bob", "daN"))
[1] "Hello" "Bob" "daN"
Is that "daN" correct?
If so, then this behavior that only *all lowercase strings*, which the
code indicates, will be capitalized is not documented.
> Hmisc::capitalize
function
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
2006 May 19
1
database.yml and encoding: utf8 -> mysql error
I have Rails 1.1, MySql 5.0 and would like to stor text as utf8 in the
db.
I have changed the character set and collation in the db to utf8 and
utf8_danish_ci - also checked the mysql to if its ok:
show collations like "%danish%";
utf8_danish_ci utf8 203 Yes 8
I then add the following
environment.rb:
$KCODE = ''u''
require ''jcode''
och database.yml
2007 Dec 02
0
UTF8 Regex in 1.2.x
So, I''ve been pounding the web for info on UTF8 in Ruby and Rails the
past couple days to concoct some validations that allow UTF8
characters. I have discovered that with the patches applied in Rails
1.2, I can get a little further by doing the following declaring
$KCODE = ''UTF8'' in environment.rb and by adding /u to regex expressions.
The only thing not working
2006 Mar 05
1
capitalize each word in a string
How do you capitalize each word in a string? Essentially, Ruby''s
version of PHP''s ucwords()? Thanks.
--
Posted via http://www.ruby-forum.com/.
2005 Mar 16
1
Re: Unicode support
How about this: we expose the known conversions of wxMBConv to wxruby
global methods. Then we create a $WXSTRING_TO_RUBY and $RUBY_TO_WXSTRING
globals that has a reference to those procs. In the ruby-string to
wxString typemap, we use ruby to invoke $WXSTRING_TO_RUBY and
$RUBY_TO_WXSTRING. That way, if people want a different method, they can
write one (even a pure-ruby one) that changes the
2010 Sep 23
2
rspec runner setting $KCODE considered harmful?
I ran across a problem today in which some code ran fine in regular
operation but failed in a test case. I scratched my head and thought "why
would running from within the test harness change the behavior of my code?"
Clearly it was the Heisenberg uncertainty principle in action! :)
I discovered the root cause was that the rspec runner is setting the magical
ruby global, $KCODE, to
2006 Jan 05
1
unicode hacks - fixes for webrick and Safari
Hello!
First, thank you Julian for the useful plugin ''unicode_hacks'' <
http://julik.textdriven.com/svn/tools/rails_plugins/unicode_hacks/>.
I have found some problems running my app in development on Webrick
and looking at it with Safari (MacOS X 10.4.3, Safari 2.0.2). Some
files are sent with different sizes (e.g. default css example, or
controls.js ), and it
2006 May 03
0
Capitalize and foreign characters?
Are there any workarounds when using capitalize on words with foreign
characters (besides, of course, having a string of replaces for each
case)? I''m getting results like this:
C?TENOIR -> C?Tenoir
Joe
--
Posted via http://www.ruby-forum.com/.
2008 May 06
1
Problem with ActionWebService and UTF-8 encoding
Hello,
I have a Rails App which serve a Soap Web Service with ActionWebService.
I accept 2 string parameters that must contain xml.
The data sent are in UTF-8, but the non-ascii char (é, à ...) in the message
are crippled at the end.
I tested the app, database, html, ... all accept utf-8, a direct http post
works well, but going through the web service broke the content.
I tried to manually set
2008 Jun 18
2
[ win32utils-Bugs-20722 ] Windows::Error.get_last_error only returns the first character (PATCH)
Bugs item #20722, was opened at 2008-06-18 15:16
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=411&aid=20722&group_id=85
Category: windows-pr
Group: Code
Status: Open
Resolution: None
Priority: 3
Submitted By: John Whitley (whitley)
Assigned to: Nobody (None)
Summary: Windows::Error.get_last_error only returns the first character (PATCH)
Initial
2009 Nov 13
3
Encoding::UTF_8 missing?
I''ve just done a fresh reinstall of OS X Snow Leopard on my mac, and I''m
having all kinds of problems with Rails, but the latest problem has me
stumped.
Whenever I run rake db:seed to populate my database I hit the following
error:
** Invoke db:seed (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:seed
rake aborted!
uninitialized constant
2006 Feb 15
1
where to set $KCODE
My application uses only UTF-8. Which is the canonical place to do
something global like setting $KCODE?
-- fxn