aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mac.c')
-rw-r--r--src/mac.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mac.c b/src/mac.c
index 91d07372578..53e56cfb541 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -262,6 +262,22 @@ posix_to_mac_pathname (const char *ufn, char *mfn, int mfnbuflen)
262 return 1; 262 return 1;
263} 263}
264 264
265#if TARGET_API_MAC_CARBON
266CFStringRef
267cfstring_create_with_utf8_cstring (c_str)
268 const char *c_str;
269{
270 CFStringRef str;
271
272 str = CFStringCreateWithCString (NULL, c_str, kCFStringEncodingUTF8);
273 if (str == NULL)
274 /* Failed to interpret as UTF 8. Fall back on Mac Roman. */
275 str = CFStringCreateWithCString (NULL, c_str, kCFStringEncodingMacRoman);
276
277 return str;
278}
279#endif
280
265#ifndef MAC_OSX 281#ifndef MAC_OSX
266 282
267/* The following functions with "sys_" prefix are stubs to Unix 283/* The following functions with "sys_" prefix are stubs to Unix