You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My understanding is that Ruby's strings are sequences of arbitrary bytes, even if the associated encoding is UTF-8. So the natural mapping to Rust would be as [u8] and Vec<u8> instead of str and String for most purposes. A couple of helpers using str should be fine (e.g. the from_utf8 function).
Functions which convert a ruby string to &str or String without verifying UTF-8 validity must be marked unsafe, otherwise they're unsound.
The text was updated successfully, but these errors were encountered:
Thanks for opening this issue. I'm going to be investigating encoding support through ruru this month so this info may come in to play. I'll be sure to provide any useful information I find on this then here.
I've been waiting for @d-unseductable to reappear on the scene of his project here and hoping to get this project moving forward. I don't know how long I'm willing to wait but I'm pretty close to making an official fork of this project (although I would be much happier as a co-maintainer of this project after discussing with Dmitry what his vision for the future of ruru is) and re-implement a few key components to be safer such as you've suggested. One such change is that new class instantiation should return a Result<AnyObject, AnyException> rather than AnyObject as Ruby is fully capable of raising exceptions in class instantiation. I've opened an issue for discussion on that specific point here: #91
But my hope is really to see this project thrive and do well so I'm still holding out hoping Dmitry shows up to revive this project.
It looks like Helix just took this issue on for their project here: tildeio/helix@faaa6b1
My understanding is that Ruby's strings are sequences of arbitrary bytes, even if the associated encoding is UTF-8. So the natural mapping to Rust would be as
[u8]
andVec<u8>
instead ofstr
andString
for most purposes. A couple of helpers usingstr
should be fine (e.g. thefrom_utf8
function).Functions which convert a ruby string to
&str
orString
without verifying UTF-8 validity must be markedunsafe
, otherwise they're unsound.The text was updated successfully, but these errors were encountered: