The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Assert valid UTF-8 test helper

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
Jonathan Weiss

Posts: 146
Nickname: jweiss
Registered: Jan, 2006

Jonathan Weiss is a Ruby and BSD enthusiast
Assert valid UTF-8 test helper Posted: Sep 26, 2006 12:58 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jonathan Weiss.
Original Post: Assert valid UTF-8 test helper
Feed Title: BlogFish
Feed URL: http://blog.innerewut.de/feed/atom.xml
Feed Description: Weblog by Jonathan Weiss about Unix, BSD, security, Programming in Ruby, Ruby on Rails and Agile Development.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jonathan Weiss
Latest Posts From BlogFish

Advertisement

A small test helper that can be useful:

def assert_valid_utf_8(text)
  assert_nothing_raised{
    text.each_char{|char| char.unpack('U') }
  }
end

Read: Assert valid UTF-8 test helper

Topic: Three ways to add Ruby Macros Previous Topic   Next Topic Topic: Ruby internals: a self-study guide to the sources

Sponsored Links



Google
  Web Artima.com   

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