User forums > Using Code::Blocks

Problem about Source Exporter plugin

(1/1)

kingfox:
When I try to export my C++ source code to a HTML file, if the destination directory which name includes Chinese character, the SoourceExporter plugin can't export the file. If I export the file to the directory which name is not includes Chinese character, the file can be exported. So, is it a bug of the Source Exporter plugin?

My environment: WinXP/SP2/CHS, MinGW/gcc 3.4.5, Code::Block Build Nov 30.

Ceniza:
It's not a big surprise, but yeah, it's a bug in the plugin.

Since I use fstream to write to a file but get the filename from a wxString, the conversion can cause problems in some cases. Please file a bug report and assign it to me so I won't forget to check it.

thomas:
ofstream file(cbU2C(filename));

cbU2C() is probably a bad choice here since it possibly does not do the correct job under Windows in "Chinese" mode.
Windows expects a UTF-16 filename, but cbU2C() returns UTF-8. It may be worth trying wxString::fn_str() instead.

Ceniza:
IIRC fn_str didn't work correctly for another program I was coding, but mb_str worked just fine. I had that problem when the path had accents and mb_str solved it. I'll just make those changes in the plugin and try to insert a chinese symbol in a path to be sure it works as expected.

Navigation

[0] Message Index

Go to full version