El S=E1bado 04 Abril 2009, KUBO Takehiro escribi=F3:
> Hi,
>
> On Sat, Apr 4, 2009 at 1:39 AM, I=F1aki Baz Castillo <ibc / aliax.net> wrot=
e:
> > Hi, I've added a method "multi_capitalize" to String class. This
> > method is done in C and basically modifies the string:
> >
> >  "record-roUTE".multi_capitalize =3D> "Record-Route"
> >
> > The problem is that after the method execution, the new String has
> > ASCII-8BIT encoding, while the original string had UTF-8 (using Ruby
> > 1.9.1).
>
>     rb_encoding *enc =3D rb_enc_get(original_string)
>
>     /* create a new string with the encoding same with the original string
> */ return rb_enc_str_new(char_pointer, length, enc);
>
> rb_str_new() makes a ASCII-8BIT string.

Thanks.

=2D-=20
I=F1aki Baz Castillo <ibc / aliax.net>