I tryed to use this to change the title of a window when a button is
pressed, but it doesn't work.
I am using this string:
const
MyUTF8String = 'Texto ł ñ ø ß á';
Encoded with UTF-8. I opened the file with TextWrangler to ensure it's
really utf-8
And tryed to set the window title with this code:
function ButtonMessagePressed: OSStatus;
var
CFString: CFStringRef;
begin
CFString := CFStringCreateWithCString(nil,
Pointer(PChar(MyUTF8String)), kCFStringEncodingUTF8);
SetWindowTitleWithCFString(MainWindow, CFString);
CFRelease(CFString);
result := 0;
end;
But it doesn't work. I only see 'Texto' and not my entire string. i.e.
the special characters disappeared.
I looked at the apple docs for SetWindowTitleWithCFString, but they
don't say anything special.
http://developer.apple.com/documentation/Carbon/Reference/Window_Manager/Reference/reference.html#//apple_ref/c/func/SetWindowTitleWithCFString
Does anyone have an idea of what is wrong?