Skip to content
This repository

Unicode-aware StringScanner implementation

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 .ruby-gemset
Octocat-spinner-32 .ruby-version
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 unicode_scanner.gemspec
README.md

Unicode String Scanner

A Unicode-aware implementation of Ruby's StringScanner.

Author Tim Morgan
Version 1.0 (Jul 11, 2012)
License Released under the MIT license.

About

Did you know that StringScanner splits codepoints? Neither did I. This one doesn't.

When would I want to use this? When you want to use StringScanner on a Unicode (UTF-n) string.

When would I not want to use this? If you're interested in speed. This is slower than StringScanner because a) it's not written in native C, and b) it's slower to traverse Unicode strings anyway because characters can have varying byte sizes.

Installation

Simply add this gem to your project's Gemfile:

gem 'unicode_scanner'

Usage

The UnicodeScanner object responds to exactly the same API as StringScanner, with the exception of the following methods:

  • getbyte
  • any obsolete methods

For more information, see the {UnicodeScanner} class documentation.

Something went wrong with that request. Please try again.