Skip to content

Commit 57a446c

Browse files
authored
back/cairo: give cairo a UTF-8 filename for PS and PDF output (#140)
cairo_ps_surface_create and cairo_pdf_surface_create take a UTF-8 char* file name, but -fileSystemRepresentation returns a UTF-16 unichar* on Windows, so the PS and PDF surfaces did not compile there. Use -UTF8String, which is a UTF-8 char* on every platform.
1 parent 23a6f27 commit 57a446c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Source/cairo/CairoPDFSurface.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ - (id) initWithDevice: (void *)device
3737

3838
// FIXME: Hard coded size in points
3939
size = NSMakeSize(400, 400);
40-
_surface = cairo_pdf_surface_create([path fileSystemRepresentation],
40+
_surface = cairo_pdf_surface_create([path UTF8String],
4141
size.width, size.height);
4242
if (cairo_surface_status(_surface))
4343
{

Source/cairo/CairoPSSurface.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ - (id) initWithDevice: (void *)device
3737

3838
// FIXME: Hard coded size in points
3939
size = NSMakeSize(400, 400);
40-
_surface = cairo_ps_surface_create([path fileSystemRepresentation], size.width, size.height);
40+
_surface = cairo_ps_surface_create([path UTF8String], size.width, size.height);
4141
if (cairo_surface_status(_surface))
4242
{
4343
DESTROY(self);

0 commit comments

Comments
 (0)