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

Function FS2OTTD

src/os/unix/unix.cpp:177–183  ·  view source on GitHub ↗

* Convert to OpenTTD's encoding from that of the local environment * @param name 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

175 * @return pointer to a new stringbuffer that contains the converted string
176 */
177std::string FS2OTTD(std::string_view name)
178{
179 static const auto convd = OpenIconv(INTERNALCODE, GetLocalCode());
180 if (!convd.has_value()) return std::string{name};
181
182 return convert_tofrom_fs(*convd, name);
183}
184
185#endif /* WITH_ICONV */
186

Callers 6

GetLastErrorAsStringFunction · 0.50
AsStringMethod · 0.50
ResolveMethod · 0.50
LoadDefaultDLSFileFunction · 0.50
HandleIMECompositionFunction · 0.50

Calls 3

OpenIconvFunction · 0.85
GetLocalCodeFunction · 0.85
convert_tofrom_fsFunction · 0.85

Tested by

no test coverage detected