diff --git a/BasiliskII/src/BeOS/extfs_beos.cpp b/BasiliskII/src/BeOS/extfs_beos.cpp index 7ee4253b..5f5d7df2 100644 --- a/BasiliskII/src/BeOS/extfs_beos.cpp +++ b/BasiliskII/src/BeOS/extfs_beos.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include "extfs.h" @@ -458,3 +459,29 @@ bool extfs_rename(const char *old_path, const char *new_path) { return rename(old_path, new_path) == 0; } + +/* + * Strings (filenames) conversion + */ + +// Convert from the host OS filename encoding to MacRoman +const char *host_encoding_to_macroman(const char *filename) +{ + int32 state = 0; + static char buffer[512]; + int32 size = sizeof(buffer) - 1; + int32 insize = strlen(filename); + convert_from_utf8(B_MAC_ROMAN_CONVERSION, filename, &insize, buffer, &size, &state); + return buffer; +} + +// Convert from MacRoman to host OS filename encoding +const char *macroman_to_host_encoding(const char *filename) +{ + int32 state = 0; + static char buffer[512]; + int32 insize = strlen(filename); + int32 size = sizeof(buffer) - 1; + convert_to_utf8(B_MAC_ROMAN_CONVERSION, filename, &insize, buffer, &size, &state); + return buffer; +}