Skip to content

Instantly share code, notes, and snippets.

@mayuki
Created April 21, 2009 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayuki/98891 to your computer and use it in GitHub Desktop.
Save mayuki/98891 to your computer and use it in GitHub Desktop.
#!ir -KS
# Encoding: Shift_JIS
a = "はうはう"
p "a = #{a}"
p "a.Length: #{a.Length}" # => 4
p "a.IsBinary: #{a.IsBinary}" # => false
p "a =~ /foo/: #{a =~ /foo/}" # => (No Error)
p "----"
p "access a[0] (or a.slice(0)): #{a[0]}" # =>
p "a.Length: #{a.Length}" # => 12
p "a.IsBinary: #{a.IsBinary}" # => true
p "a =~ /foo/: #{a =~ /foo/}" # => FAIL!!
p "----"
p "call a.GetCharCount(): #{a.GetCharCount()}" # => 4
p "a.Length: #{a.Length}" # => 4
p "a.IsBinary: #{a.IsBinary}" # => false
p "a =~ /foo/: #{a =~ /foo/}" # => (No Error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment