Commit Graph

8 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto adc5b56c15 use mrb_int instead of size_t since string length is represented by mrb_int; close #1810 2014-03-05 21:51:44 +09:00
chasonr 5e5ee841a1 Implement sprintf("%c") for UTF-8.
* sprintf("%c") is changed to accept a string for which String#size returns
  1, even if it is longer than one byte, and to convert a Fixnum via
  Fixnum#chr (possibly returning more than one byte).  Thus, if the UTF-8
  gem is in use, a character will be understood as a single UTF-8 character.

* The change to sprintf depends on the implementation of Fixnum#chr added
  to mrbgems/mruby-string-utf8/src/string.c.

This should work with any other gem that implements a multibyte encoding, as
long as it implements String#size and Fixnum#chr as appropriate.
2014-02-26 20:18:26 -05:00
h2so5 1717666662 fix utf-8 codepage 2014-01-23 03:38:54 +09:00
h2so5 61745a4727 String#length should be an alias of String#size 2014-01-10 20:01:04 +09:00
h2so5 7fc9264b0f add String#reverse, String#reverse! for UTF-8 2014-01-08 02:21:19 +09:00
Yukihiro "Matz" Matsumoto 78ab979ef9 mruby-string-utf8: redefine String#size for UTF-8 string; #1646 2014-01-07 16:24:09 +09:00
Yukihiro "Matz" Matsumoto dc25f85bab mruby-string-utf8: UTF-8 string may contail NUL; #1646 2014-01-07 15:00:55 +09:00
mattn 055468bfa0 Add mruby-string-utf8 2014-01-07 14:25:08 +09:00