-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RString default encoding is ASCII-8Bit #67
Comments
This function will return a new Ruby string with UTF8 encoding. This commit is for the issue described in d-unsed/ruru#67.
This function will return a new Ruby string with UTF8 encoding. This commit is for the issue described in d-unsed/ruru#67.
These functions will return a new Ruby string with UTF8 encoding.
These functions will return a new Ruby string with UTF8 encoding. This is for the issue described in d-unsed#67
Created two commits to deal with this issue: |
#71 will be merged after we release new version of ruby-sys |
Any update on releasing a new version of ruby-sys with steveklabnik/ruby-sys/pull/23 merged? Thanks! |
I've published ruby-sys 0.3.0 |
On encoding I'd be interested if we could implement the same encoding support that Ruby has. I'm playing around with some ideas. The main issue to test against is this test https://github.com/ruby/spec/blob/29b472cf57946ce271533fc6e03716908a313aaf/core/file/basename_spec.rb#L162-L166 which simply tests the same encoding goes in and out. |
These functions will return a new Ruby string with UTF8 encoding. This is for the issue described in d-unsed#67
I suppose this could be closed per #71, yeah? |
I have one more question regarding encodings. Since Ruby by default creates a string with UTF-8 encoding ( I mean the following steps:
Then ruru and ruby will have the same default behavior. This can be implemented in 0.10.0 |
I think changing the |
I agree with making the default for I think keeping |
This totally makes sense to me. |
This function will return a new Ruby string with UTF8 encoding. This commit is for the issue described in d-unsed/ruru#67.
I made a small example to show the "issue". It is available here: https://github.com/mikeycgto/ruru-rstring-encoding#example.
While this isn't incorrect it does feel a little odd since in modern Ruby and Rust both default to UTF-8 encoding.
Perhaps ruby-sys should expose
rb_utf8_str_new
as well? The RString struct could then maybe have anew_from_utf8
function which will ultimately call this Ruby C function. I can make the necessary PRs but I wanted some feedback first.The text was updated successfully, but these errors were encountered: