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

Function ISC_utf8ToSystem

src/common/isc_file.cpp:1839–1858  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1837
1838// Converts a string from UTF-8 to the system charset.
1839void ISC_utf8ToSystem(Firebird::AbstractString& str)
1840{
1841 if (str.isEmpty())
1842 return;
1843
1844#if defined(WIN_NT)
1845 WideCharBuffer<MAX_PATH> wBuffer;
1846
1847 if (!wBuffer.fromString(CP_UTF8, str) || !wBuffer.toString(CP_ACP, str))
1848 {
1849 DWORD err = GetLastError();
1850 status_exception::raise(
1851 Arg::Gds(isc_bad_conn_str) << Arg::Gds(isc_transliteration_failed) <<
1852 Arg::Windows(err));
1853 }
1854
1855#elif defined(HAVE_ICONV_H)
1856 iConv().utf8ToSystem.convert(str);
1857#endif
1858}
1859
1860
1861// Escape Unicode characters from a string

Callers 13

add_other_paramsFunction · 0.85
add_working_directoryFunction · 0.85
analyzeFunction · 0.85
initFunction · 0.85
accept_connectionFunction · 0.85
addClumpletsFunction · 0.85
toSystemMethod · 0.85
toSystemMethod · 0.85
internalAttachMethod · 0.85
createDatabaseMethod · 0.85
expandDatabaseNameFunction · 0.85
strFromUtf8Function · 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