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 selafin special characters #484

Merged

Conversation

nstrahl
Copy link
Contributor

@nstrahl nstrahl commented Mar 21, 2024

Fixes #483

First off, a regression test (WriteDatasetSpecialCharacters) was written so that the issue at hand could be reproduced.
Then the issue was fixed. Some instances of std::string had to be converted to std::wstring followed by windows-specific system calls.
The solution is analogous to the way cross-platform strings are currently handled in mdal_utils.h/.cpp.

Copy link
Contributor

@PeterPetrik PeterPetrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the stuff!

//! Deletes a file. Returns true on success, false otherwise
bool deleteFile( const std::string &path );

//!renames a file. Returns true on success, false otherwise
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//!renames -> //! Renames

std::wstring wStr = converter.from_bytes( path );
return DeleteFileW( wStr.c_str() ) != 0;
#else
return remove( path.c_str() ) == 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::remove

@nstrahl nstrahl requested a review from PeterPetrik April 5, 2024 07:26
@PeterPetrik PeterPetrik merged commit dd52e9e into lutraconsulting:master Apr 8, 2024
7 of 8 checks passed
@nstrahl
Copy link
Contributor Author

nstrahl commented Apr 8, 2024

Thanks! Could you make a patch version (1.1.1) for the last fixes? Or would that be too soon according to the roadmap?

@PeterPetrik
Copy link
Contributor

@uclaros ?

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.

Writing a selafin mesh dataset to a file path with special characters fails under windows
2 participants