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

[Import] DXF make codepage case insensitive #9712

Merged
merged 2 commits into from Jun 14, 2023

Conversation

Syres916
Copy link
Contributor

@Syres916 Syres916 commented Jun 2, 2023

See discussion https://forum.freecad.org/viewtopic.php?t=78719

I don't believe #8704 is fixed even after this change, the example file Encoding-error.dxf which can be opened by VariCAD Viewer still opens error free in FreeCAD but has nothing in the 3D View.

Thank you for creating a pull request to contribute to FreeCAD! Place an "X" in between the brackets below to "check off" to confirm that you have satisfied the requirement, or ask for help in the FreeCAD forum if there is something you don't understand.

  • Your Pull Request meets the requirements outlined in section 5 of CONTRIBUTING.md for a Valid PR

Please remember to update the Wiki with the features added or changed once this PR is merged.
Note: If you don't have wiki access, then please mention your contribution on the 1.0 Changelog Forum Thread.


See discussion https://forum.freecad.org/viewtopic.php?t=78719

I don't believe FreeCAD#8704 is fixed even after this change, the example file Encoding-error.dxf which can be opened by Varicad Viewer still opens error free but has nothing in the 3D view.
@Syres916
Copy link
Contributor Author

@yorikvanhavre Could you please review this PR, TIA

Copy link
Member

@yorikvanhavre yorikvanhavre left a comment

Choose a reason for hiding this comment

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

Looks good to me! I was wondering if there isn't a better way to convert a string to lowercase, you could use boost:

[Boost provides a string algorithm for this](https://www.boost.org/doc/libs/1_70_0/doc/html/boost/algorithm/to_lower.html):

#include <boost/algorithm/string.hpp>

std::string str = "HELLO, WORLD!";
boost::algorithm::to_lower(str); // modifies str

[Or, for non-in-place](https://www.boost.org/doc/libs/1_70_0/doc/html/boost/algorithm/to_lower_copy.html):

#include <boost/algorithm/string.hpp>

const std::string str = "HELLO, WORLD!";
const std::string lower_str = boost::algorithm::to_lower_copy(str);

But I leave that to you... If you prefer to stick with this version we merge it as is

@Syres916
Copy link
Contributor Author

Thanks for the feedback Yorik but I did try the boost method and failed miserably, so I'm happy to merge as is.

@yorikvanhavre yorikvanhavre merged commit de5e8e1 into FreeCAD:master Jun 14, 2023
6 checks passed
@yorikvanhavre
Copy link
Member

ok done!

@Syres916 Syres916 deleted the patch-80 branch August 4, 2023 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants