MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / OpenIconv

Function OpenIconv

src/os/unix/unix.cpp:149–157  ·  view source on GitHub ↗

* Open iconv converter. */

Source from the content-addressed store, hash-verified

147 * Open iconv converter.
148 */
149static std::optional<iconv_t> OpenIconv(std::string from, std::string to)
150{
151 iconv_t convd = iconv_open(from.c_str(), to.c_str());
152 if (convd == reinterpret_cast<iconv_t>(-1)) {
153 Debug(misc, 0, "[iconv] conversion from codeset '{}' to '{}' unsupported", from, to);
154 return std::nullopt;
155 }
156 return convd;
157}
158
159/**
160 * Convert from OpenTTD's encoding to that of the local environment

Callers 2

OTTD2FSFunction · 0.85
FS2OTTDFunction · 0.85

Calls 1

c_strMethod · 0.45

Tested by

no test coverage detected