File and fopen


#1

I'm using FileChooser to select file on disk. FileChooser results are File objects and from them I can get filenames.

Problem is that many filenames contain characters with codes larger than 127 (Chineese, Cyrilic,...).

How can I get filenames that 'fopen' will understand?


#2

Why not use:

http://www.juce.com/api/classFileInputStream.html

Rail


#3

Unfortunately this is not possible.


#4

Then try http://www.juce.com/api/classString.html#ae79ca95309b6b8a7987e8b2f2efef297 (String::toWideCharPointer() with _wfopen()) or one of the relevant functions for your platform.

Rail


#5

_wfopen is only available on Windows.

I found solution with short filenames and it seems to work.


#6

String has a whole bunch of methods for getting character data out of it - for unixes you'd probably want to use something like myFile.getFullPathName().toRawUTF8()