ihedvall / mdflib

Implementation of the ASAM MDF data file.
https://ihedvall.github.io/mdflib/
MIT License
69 stars 29 forks source link

fix coding error #17

Closed Simplxss closed 1 year ago

Simplxss commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Thanks for your instructions, I will change it later.