Could any developer tell me how to convert an utf8 string (like the one "info->get_file_path()" returns), to something that a fopen() could understand?
(I know i should be using the reader class, but I don't plan to modify the whole read funcion right now)
I've been checking the sources, and the nearer thing i've found is the param_os_to_utf8 class, but I don't know how to use that. Any clues?
Uh oh, using fread sounds like a really bad idea...
Anyway, you get Ansi string from UTF-8 with string_ansi_from_utf8(utf8_string).
Tried that already, but it gives me an uninitialized string ( that is.. all "ÍÍÍÍ"... ).
,Jul 13 2003, 07:44 PM] Tried that already, but it gives me an uninitialized string ( that is.. all "ÍÍÍÍ"... ).
Can you post your code that gets invalid values from string_ansi_from_utf8 and exact SDK version number you are using ?
This is the line
const char *_f = string_ansi_from_utf8(info->get_file_path());
from inside the "virtual int open(reader * r,file_info * info,int full_open)" function.
(Edit: btw, this is an input plugin)
I've tried this with the 0.7SDK (b15). I might be doing something wrong if that should work.
I just include in my project files the file "component_client.cpp" and include the following headers in the main file:
I link to foobar2000_SDK.lib alone.
It creates temporary string_ansi_from_utf8 object, gets the string pointer from it, then immediately destroys it.
Thanks. That made it work.
The component is the foo_psy, which I'll update it soon in the 3rd party components ( new tracker engine version ).