* 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 */
| 175 | * @return pointer to a new stringbuffer that contains the converted string |
| 176 | */ |
| 177 | std::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 |
no test coverage detected