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
Implement Unicode support for RL.Net #59
Conversation
* Fixes marshalling empty strings from C++ to .Net side
@@ -65,6 +65,11 @@ API int LiveModelInit(livemodel_context_t* context, reinforcement_learning::api_ | |||
|
|||
API int LiveModelChooseRank(livemodel_context_t* context, const char * event_id, const char * context_json, reinforcement_learning::ranking_response* resp, reinforcement_learning::api_status* status) | |||
{ | |||
if (event_id == nullptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check looks unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch. Under the check, it was chaining to the wrong method in the nullptr case. It is supposed to go to the auto-generate EventId code.
* Fixes output of rl.net.cli.test to match the rest of the dotnet project output paths * Change RoundtripTest to use NativeMethods.StringMarshallingFunc to test that it is symmetric with NativeMethods.StringEncoding * Changes pseudoloc strings to include the bit that crashed iOS messaging as a known example of potential issues with Unicode * Removes commented out configuration / code * Remove superfluous Run_LiveModelChooseRankXYZ test calls (from Test_LiveModel_ChooseRankE2E, they are run in Test_ListModel_ChooseRank below it) * Add a test to ensure non-nullptr arrays that begin with \0 are marshalled properly as an empty string
When we first built the .Net bindings for rlclientlib we make a decision to only support ASCII. (VowpalWabbit/vowpal_wabbit#1601). This will behave incorrectly when sending text with code points outside of ASCII.
This change implements proper marshalling using UTF8.