MCPcopy Create free account
hub / github.com/SpartanJ/eepp / encodingFromString

Function encodingFromString

src/tests/unit_tests/textformat.cpp:14–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12using namespace EE::UI::Doc;
13
14TextFormat::Encoding encodingFromString( const std::string_view& str ) {
15 if ( str == "utf16be" )
16 return TextFormat::Encoding::UTF16BE;
17 if ( str == "utf16le" )
18 return TextFormat::Encoding::UTF16LE;
19 if ( str == "win1252" )
20 return TextFormat::Encoding::Latin1;
21 if ( str == "shiftjis" )
22 return TextFormat::Encoding::Shift_JIS;
23 if ( str == "utf8" )
24 return TextFormat::Encoding::UTF8;
25 return TextFormat::Encoding::UTF8;
26}
27
28UTEST( TextFormat, autodetect ) {
29 FileSystem::changeWorkingDirectory( Sys::getProcessPath() );

Callers 2

createDocumentMenuMethod · 0.85
UTESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected