The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Nikolai's UTF-8 Lib is All Ready

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
Nikolai's UTF-8 Lib is All Ready Posted: Jul 24, 2006 10:40 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Nikolai's UTF-8 Lib is All Ready
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

Last week, in the comments, Nikolai Weibull brought up his UTF-8 lib, a lovely creature which meets my own needs much better than what’s already out there. I like it much better than my own efforts. Especially now that he’s had some time to flesh it out.

Namely: It’s small. It’s coded in C. It locks into Ruby’s existing string class. Therefore, it can be efficient with memory and use Ruby’s own regexps.

 require 'encoding/character/utf-8'
 str = u"hëllö" 
 str.length
 #=> 5
 str.reverse.length
 #=> 5
 str[/ël/]
 #=> "ël" 

If you’d like to follow development, clone this (git-web.) I’ve also put up a gem: gem install character-encodings --source code.whytheluckystiff.net, but obviously it’s not an official release or anything.

Read: Nikolai's UTF-8 Lib is All Ready

Topic: Rails HTML Caching Fun Previous Topic   Next Topic Topic: Hpricot and Sandbox for Win32

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use