String to CFStringRef?


#1

I need a CFStringRef for some work with CFBundleCopyResourceURL(), and what I have is a juce string.

What’s the best way to do the conversion?
CFStringreateWithCString() looks to be a possibility, but both CFString and juce_String can deal with unicode, so it seems a shame to downcast to UTF-8. Is there a better way?


#2

There’s code hidden away in the mac-specific juce code where I wrote a function to do this - have a search through and see how that does it…


#3

Thanks. PlatformUtilities::juceStringToCFString() is the function, to save others the search.