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