Use utf8. Partially reverts e35174d64b
This commit is contained in:
parent
e35174d64b
commit
b596568ce4
|
@ -36,9 +36,20 @@ public:
|
||||||
|
|
||||||
bool CheckFileHeader( const std::filesystem::path& aPath ) const;
|
bool CheckFileHeader( const std::filesystem::path& aPath ) const;
|
||||||
|
|
||||||
|
bool CheckFileHeader( const std::string& aPath ) const
|
||||||
|
{
|
||||||
|
return CheckFileHeader( std::filesystem::path( aPath ) );
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
CADSTAR_PARTS_LIB_MODEL ReadContent( const std::string& aSource ) const;
|
CADSTAR_PARTS_LIB_MODEL ReadContent( const std::string& aSource ) const;
|
||||||
|
|
||||||
CADSTAR_PARTS_LIB_MODEL ReadFile( const std::filesystem::path& aPath ) const;
|
CADSTAR_PARTS_LIB_MODEL ReadFile( const std::filesystem::path& aPath ) const;
|
||||||
|
|
||||||
|
CADSTAR_PARTS_LIB_MODEL ReadFile( const std::string& aPath ) const
|
||||||
|
{
|
||||||
|
return ReadFile( std::filesystem::path( aPath ) );
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //CADSTAR_PARTS_LIB_PARSER_H
|
#endif //CADSTAR_PARTS_LIB_PARSER_H
|
||||||
|
|
|
@ -67,12 +67,12 @@ std::vector<LIB_SYMBOL*> CADSTAR_SCH_ARCHIVE_LOADER::LoadPartsLib( const wxStrin
|
||||||
|
|
||||||
CADSTAR_PARTS_LIB_PARSER p;
|
CADSTAR_PARTS_LIB_PARSER p;
|
||||||
|
|
||||||
if( !p.CheckFileHeader( aFilename.fn_str() ) )
|
if( !p.CheckFileHeader( aFilename.utf8_string() ) )
|
||||||
THROW_IO_ERROR(
|
THROW_IO_ERROR(
|
||||||
_( "The selected file does not appear to be a CADSTAR parts Library file" ) );
|
_( "The selected file does not appear to be a CADSTAR parts Library file" ) );
|
||||||
|
|
||||||
// TODO: we could add progress reporting for reading .lib
|
// TODO: we could add progress reporting for reading .lib
|
||||||
CADSTAR_PARTS_LIB_MODEL csLib = p.ReadFile( aFilename.fn_str() );
|
CADSTAR_PARTS_LIB_MODEL csLib = p.ReadFile( aFilename.utf8_string() );
|
||||||
|
|
||||||
if( m_progressReporter )
|
if( m_progressReporter )
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,7 +57,7 @@ bool CADSTAR_SCH_ARCHIVE_PLUGIN::CanReadLibrary( const wxString& aFileName ) con
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CADSTAR_PARTS_LIB_PARSER p;
|
CADSTAR_PARTS_LIB_PARSER p;
|
||||||
return p.CheckFileHeader( aFileName.fn_str() );
|
return p.CheckFileHeader( aFileName.utf8_string() );
|
||||||
}
|
}
|
||||||
catch( const std::runtime_error& )
|
catch( const std::runtime_error& )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue