Skip to content
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

fix coding error #17

Merged
merged 2 commits into from
Jul 19, 2023
Merged

fix coding error #17

merged 2 commits into from
Jul 19, 2023

Conversation

Simplxss
Copy link
Collaborator

@Simplxss Simplxss commented Jul 19, 2023

Fix String coding error when return String to C#

I think it's better to create a function to do the coding convinsion, but I don't find approprite place to put it.

@ihedvall
Copy link
Owner

Thanks for finding the bug.
Normally a library have a helper class with this type of static functions. In C++/CLI code the MdfLibrary class (mdflibrary.h/cpp) is typically used for those purposes. So I recommend to add a static function like:
static String^ Utf8Conversion(const std::string& utf8_string);
to the MdfLibrary class.

Optionally a unit test (see mdflibrary_test) can be added. Sometimes an empty string generates unexpected results.

I add you as a contributer to the repository.

@Simplxss
Copy link
Collaborator Author

Thanks for your instructions, I will change it later.

and replace the former code
@ihedvall ihedvall merged commit e3f7540 into ihedvall:main Jul 19, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants