MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / ISC_systemToUtf8

Function ISC_systemToUtf8

src/common/isc_file.cpp:1816–1835  ·  view source on GitHub ↗

Converts a string from the system charset to UTF-8.

Source from the content-addressed store, hash-verified

1814
1815// Converts a string from the system charset to UTF-8.
1816void ISC_systemToUtf8(Firebird::AbstractString& str)
1817{
1818 if (str.isEmpty())
1819 return;
1820
1821#if defined(WIN_NT)
1822 WideCharBuffer<MAX_PATH> wBuffer;
1823
1824 if (!wBuffer.fromString(CP_ACP, str) || !wBuffer.toString(CP_UTF8, str))
1825 {
1826 DWORD err = GetLastError();
1827 status_exception::raise(
1828 Arg::Gds(isc_bad_conn_str) << Arg::Gds(isc_transliteration_failed) <<
1829 Arg::Windows(err));
1830 }
1831
1832#elif defined(HAVE_ICONV_H)
1833 iConv().systemToUtf8.convert(str);
1834#endif
1835}
1836
1837
1838// Converts a string from UTF-8 to the system charset.

Callers 15

INET_analyzeFunction · 0.85
add_other_paramsFunction · 0.85
add_working_directoryFunction · 0.85
makeUtfStringFunction · 0.85
XNET_analyzeFunction · 0.85
addClumpletsFunction · 0.85
setupSkipDataMethod · 0.85
setupIncludeDataMethod · 0.85
authenticateMethod · 0.85
readConfigMethod · 0.85
TracePluginImplMethod · 0.85
getPathMethod · 0.85

Calls 7

raiseFunction · 0.85
GdsClass · 0.85
WindowsClass · 0.85
isEmptyMethod · 0.45
fromStringMethod · 0.45
toStringMethod · 0.45
convertMethod · 0.45

Tested by

no test coverage detected