Ruby and unicode

Does Ruby support unicode? If not it's a disappointment.

···

--
Posted via http://www.ruby-forum.com/.

Well, there are extension libraries for handling unicodes. It is also expected that Ruby 2.0 will bring more complete I18N supports.

What are your needs?

daesan

···

On May 25, 2006, at 3:05 AM, Pål Bergström wrote:

Does Ruby support unicode? If not it's a disappointment.

--
Posted via http://www.ruby-forum.com/\.

Dae San Hwang
daesan@gmail.com

Dae San Hwang wrote:

Well, there are extension libraries for handling unicodes. It is
also expected that Ruby 2.0 will bring more complete I18N supports.

What are your needs?

daesan

Does Ruby support unicode? If not it's a disappointment.

--
Posted via http://www.ruby-forum.com/\.

Dae San Hwang
daesan@gmail.com

Just to be able to work smoothly from source to browser in Swedish
without problems, the beauty of unicode. As I can understand it works
like php, where certain methods like string lengths can give problems,
but besides that it just passes it through. Is this correct?

···

On May 25, 2006, at 3:05 AM, Pål Bergström wrote:

--
Posted via http://www.ruby-forum.com/\.

Pål, you don't have to use unicode to work in swedish. ISO-8859-1 will
be sufficient to get accented characters including åäö. ISO-8859-1 is
handled by Ruby without any problems.

If your are working in Rails, please see the swedish Rails user group
wiki for details:

http://rails.se/rails/show/Railstips+för+svenska+applikationer

Regards,

Peter

···

On 5/24/06, Pål Bergström <pal@palbergstrom.com> wrote:

Just to be able to work smoothly from source to browser in Swedish
without problems, the beauty of unicode.

Yes, strings in UTF8 (or any character set for that matter) simply pass through since they are just byte sequence.

If you need methods that properly manipulate UTF8 strings, install unicode gem and install unicode hacks from http://julik.textdriven.com/svn/tools/rails_plugins/unicode_hacks/

Unicode hacks replaces String methods with UTF8 aware versions.

You would also need to put following code snippet in config/environment.rb:

$KCODE = 'u'

http://wiki.rubyonrails.com/rails/pages/HowToUseUnicodeStrings is a good resource for unicode usage on rails.

daesan

···

On May 25, 2006, at 4:20 AM, Pål Bergström wrote:

Just to be able to work smoothly from source to browser in Swedish
without problems, the beauty of unicode. As I can understand it works
like php, where certain methods like string lengths can give problems,
but besides that it just passes it through. Is this correct?

Dae San Hwang
daesan@gmail.com

You should not advise the use of unicode hacks plugin, since it will very probably break any Rails application.

See for example <http://www.fngtps.com/2006/01/encoding-in-rails&gt; and <http://redhanded.hobix.com/inspect/unicodeLibForRuby18.html&gt;\.\.\.

Regards,

izidor

···

On 24.5.2006, at 23:02, Dae San Hwang wrote:

If you need methods that properly manipulate UTF8 strings, install unicode gem and install unicode hacks from http://julik.textdriven.com/svn/tools/rails_plugins/unicode_hacks/

Unicode hacks replaces String methods with UTF8 aware versions.

Right, that is because Rails depend on many of String methods that unicode_hacks replaces.

However, you can just rename the method names in unicode_hacks. I just add 'u_' prefix to all the methods in unicode_hacks.

Cheers,
Daesan

···

On May 27, 2006, at 1:38 AM, Izidor Jerebic wrote:

On 24.5.2006, at 23:02, Dae San Hwang wrote:

If you need methods that properly manipulate UTF8 strings, install unicode gem and install unicode hacks from http://julik.textdriven.com/svn/tools/rails_plugins/unicode_hacks/

Unicode hacks replaces String methods with UTF8 aware versions.

You should not advise the use of unicode hacks plugin, since it will very probably break any Rails application.

See for example <http://www.fngtps.com/2006/01/encoding-in-rails&gt; and <http://redhanded.hobix.com/inspect/unicodeLibForRuby18.html&gt;\.\.\.

Regards,

izidor

Dae San Hwang
daesan@gmail.com