diff options
| author | chasonr <[email protected]> | 2014-02-26 20:18:26 -0500 |
|---|---|---|
| committer | chasonr <[email protected]> | 2014-02-26 20:18:26 -0500 |
| commit | 5e5ee841a1c6aee13c7683b233c26d7db79f9c2f (patch) | |
| tree | f5645e1ab9415881efd5e3adef5a60f616d300cb /src | |
| parent | 313f6b599796e84da07b850bf2b5d341bf2c156a (diff) | |
| download | mruby-5e5ee841a1c6aee13c7683b233c26d7db79f9c2f.tar.gz mruby-5e5ee841a1c6aee13c7683b233c26d7db79f9c2f.zip | |
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.
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions
