@@ -77,7 +77,8 @@ extern void MCRemotePageSetupDialog(MCDataRef p_config_data, MCDataRef &r_reply_
7777
7878// /////////////////////////////////////////////////////////////////////////////
7979
80- extern char *osx_cfstring_to_cstring (CFStringRef p_string, bool p_release = true );
80+ // SN-2014-12-22: [[ Bug 14278 ]] Parameter added to choose a UTF-8 string.
81+ extern char *osx_cfstring_to_cstring (CFStringRef p_string, bool p_release = true , bool p_utf8_string = false );
8182extern bool MCImageBitmapToCGImage (MCImageBitmap *p_bitmap, bool p_copy, bool p_invert, CGImageRef &r_image);
8283extern bool MCGImageToCGImage (MCGImageRef p_src, MCGRectangle p_src_rect, CGColorSpaceRef p_colorspace, bool p_copy, bool p_invert, CGImageRef &r_image);
8384extern bool MCGImageToCGImage (MCGImageRef p_src, MCGRectangle p_src_rect, bool p_copy, bool p_invert, CGImageRef &r_image);
@@ -689,7 +690,8 @@ void MCMacOSXPrinter::SetProperties(bool p_include_output)
689690 PDEBUG (stderr, " SetProperties: Output location is file\n " );
690691 CFStringRef t_output_format;
691692 t_output_type = PRINTER_OUTPUT_FILE;
692- t_output_location = osx_cfstring_to_cstring (CFURLCopyFileSystemPath (t_output_location_url, kCFURLPOSIXPathStyle ), true );
693+ // SN-2014-12-22: [[ Bug 14278 ]] Get a UTF-8-encoded filename
694+ t_output_location = osx_cfstring_to_cstring (CFURLCopyFileSystemPath (t_output_location_url, kCFURLPOSIXPathStyle ), true , true );
693695 }
694696 else if (t_type == kPMDestinationPrinter )
695697 {
@@ -704,8 +706,9 @@ void MCMacOSXPrinter::SetProperties(bool p_include_output)
704706 t_output_location = NULL ;
705707 }
706708
707- MCAutoStringRef t_output_location_str;
708- /* UNCHECKED */ MCStringCreateWithCString (t_output_location, &t_output_location_str);
709+ MCAutoStringRef t_output_location_str;
710+ // SN-2014-12-22: [[ Bug 14278 ]] We get the output location as a UTF-8 string.
711+ /* UNCHECKED */ MCStringCreateWithBytes ((byte_t *)t_output_location, strlen (t_output_location), kMCStringEncodingUTF8 , false , &t_output_location_str);
709712 SetDeviceOutput (t_output_type, *t_output_location_str);
710713
711714 delete t_output_location;
@@ -925,7 +928,8 @@ void MCMacOSXPrinter::GetProperties(bool p_include_output)
925928 case PRINTER_OUTPUT_FILE:
926929 {
927930 CFStringRef t_output_file;
928- t_output_file = CFStringCreateWithCString (kCFAllocatorDefault , GetDeviceOutputLocation (), kCFStringEncodingMacRoman );
931+ // SN-2014-12-22: [[ Bug 14278 ]] Output location now stored as a UTF-8 string
932+ t_output_file = CFStringCreateWithCString (kCFAllocatorDefault , GetDeviceOutputLocation (), kCFStringEncodingUTF8 );
929933 t_output_url = CFURLCreateWithFileSystemPath (kCFAllocatorDefault , t_output_file, kCFURLPOSIXPathStyle , false );
930934 CFRelease (t_output_file);
931935 t_output_type = kPMDestinationFile ;
0 commit comments