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

Function OTTD2FS

src/os/unix/unix.cpp:164–170  ·  view source on GitHub ↗

* Convert from OpenTTD's encoding to that of the local environment * @param name pointer to a valid string that will be converted * @return pointer to a new stringbuffer that contains the converted string */

Source from the content-addressed store, hash-verified

162 * @return pointer to a new stringbuffer that contains the converted string
163 */
164std::string OTTD2FS(std::string_view name)
165{
166 static const auto convd = OpenIconv(GetLocalCode(), INTERNALCODE);
167 if (!convd.has_value()) return std::string{name};
168
169 return convert_tofrom_fs(*convd, name);
170}
171
172/**
173 * Convert to OpenTTD's encoding from that of the local environment

Callers 2

PlaySongMethod · 0.50
MakeWindowMethod · 0.50

Calls 3

OpenIconvFunction · 0.85
GetLocalCodeFunction · 0.85
convert_tofrom_fsFunction · 0.85

Tested by

no test coverage detected