Never use the first code . As written in the Qt documentation, it may not work in a non-English environment due to the fact that the file name encoding is not CFStringGetSystemEncoding(), which returns the main non-Unicode encoding of the user. Instead, the file name is always encoded in UTF8 (with a small option).
const char *pathPtr = CFStringGetCStringPtr(macPath, kCFStringEncodingUTF8);
, CFStringGetFileSystemRepresentation.
QCoreApplication::applicationDirPath() ( ) , , , Mac.