boostorg / lexical_cast

General literal text conversions, such as an int represented as a string, or vice versa
https://boost.org/libs/lexical_cast
34 stars 58 forks source link

boost::filesystem::path with witespaces #58

Closed ohhmm closed 7 months ago

ohhmm commented 1 year ago

boost::filesystem::path is being deserialized to the first whitespace occurrence.

apolukhin commented 8 months ago

Could you please provide a reproducer?

ohhmm commented 8 months ago

C:\Program Files on Windows deserialized to C:\Program

apolukhin commented 8 months ago

@ohhmm to what type are you deserializing? Is that std::string?

apolukhin commented 8 months ago

Is the path quoted or not? All the above cases are covered with tests:

https://github.com/boostorg/lexical_cast/blob/3433c34b43969f2d3fc7309d895ef66019e3cfc1/test/filesystem_test.cpp#L35-L51

What version of Boost are you using?

ohhmm commented 8 months ago

I reproduced it using boost::program_options where option type is boost::filesystem::path. Tried it with multiple versions of boost on Windows. Tried with both quotations enabled/disabled.

apolukhin commented 8 months ago

@ohhmm is your case not covered by the tests in https://github.com/boostorg/lexical_cast/blob/3433c34b43969f2d3fc7309d895ef66019e3cfc1/test/filesystem_test.cpp#L35-L51

?

If not covered, please provide a reproducer