Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: paul_c_weiss on April 07, 2016, 05:14:00 pm
-
Hello!
I have been working with code::blocks 13.12 together with wxWidgets 2.8, quite satisfactorily. All my projects resort to UTF-8 encoding.
Recently, I have installed the 16.01 version together with wxWidgets 3.0.
To port my test project, I have simply manually edited the .cpb files, to have it point to the correct wxWidgets repertories.
This works quite nicely. The project complies and runs OK, with a small exception:
The accentuated characters which I have defined in the wxSmith "labels" are not correctely handled - i. e. they are not seen as UTF-8
and give the usual character salad which appears in such cases...
Preforming some tests, I realized that replacing the _() macro by the _T() one did yield the right result (why????)
Unfortunately, wxSmith resorts to the _() macro in its automatically generated sections, which I cannot safely change.
Thus I can only correct the problem by programatically setting the label at a later stage, which is not quite satisfactory.
Is there somewhere an option that I have overlooked and which allows to get the right behaviour?
Or is this a bug?
Thanks in advance.
-
maybe this can help:
"Settings->Editor->wxSmith Settings->Other Settings->Non I18N Strings"
greetings
-
Thank you!
Unfortunately, I cannot see such an option as:
"Settings->Editor->wxSmith Settings->Other Settings->Non I18N Strings"
under Code::Blocks 16:01 as downloaded...
-
it is possible that the option was added after the release...
you can try a nightly build from the forum: http://forums.codeblocks.org/index.php/topic,21090.0.html
greetings
-
Hello!
To avoid re-installing a nightly build, I tried and edited the following section of the project file:
<wxsmith version="1">
<gui name="wxWidgets" src="SudokuApp.cpp" main="SudokuFrame" init_handlers="necessary" language="CPP" />
<resources>
<wxFrame wxs="wxsmith/Sudokuframe.wxs" src="SudokuMain.cpp" hdr="SudokuMain.h" fwddecl="0" i18n="1" name="SudokuFrame" language="CPP" />
</resources>
</wxsmith>
Obviously by replacing i18n="1"by i18n="0"
Is this equivalent to changing the option? - I hoped so!
Now simply rebuilding the project has no effect.
If I force a regeneration of the wxSmith-generated parts of the program, by performing a minute modification of the
.wxs file, then, after rebuilding, I get an execution error ( status -1073741819).
But wxSmith is still using the _() macro which is not satisfactory...
Do you have reason to think that the nightlx build may behave differently??
Regards,
-
installing a nightly isn't that difficult/space consuming... try it and you are sure...
NOTE: you don't install a nightly, you simply download it, unzip it and run it. You even can copy it over the release installation. BUT you need also the right dlls from the nightly forum post.
Modifying some project files by hand is no good idea. And also i don't think that this feature was implemented before the added option in the dialog, so yes i think that a nightly is behaving differently...
greetings
-
Thank you,
While the issue is real, I now think that I am coping with another problem, since minor modifications on my wxSmith file
cause execution errrors which cannot be corrected. What I mean is that changing a dimension (using the GUI)
induces an execution error, and then correcting back the dimension to its former value does not suppress
the error, after project re-building....
This is a totally different issue which I must now understand.
I shall later come back to the UTF-8 issue
Thanks for your help!
-
I know the topic is old, but the problem has not yet been resolved.
Unfortunately
maybe this can help:
"Settings->Editor->wxSmith Settings->Other Settings->Non I18N Strings"
does not work.
(https://i.ibb.co/Vmj02Vq/01.png) (https://ibb.co/Vmj02Vq) (https://i.ibb.co/68ndsjf/02.png) (https://ibb.co/68ndsjf)
But editing directly as suggested
<wxsmith version="1">
<gui name="wxWidgets" src="SudokuApp.cpp" main="SudokuFrame" init_handlers="necessary" language="CPP" />
<resources>
<wxFrame wxs="wxsmith/Sudokuframe.wxs" src="SudokuMain.cpp" hdr="SudokuMain.h" fwddecl="0" i18n="1" name="SudokuFrame" language="CPP" />
</resources>
</wxsmith>
Obviously by replacing i18n="1"by i18n="0"
it works perfectly.
Thank you, your tip helped me, it was already with your head hot.
-
Use of i18N in wxSmith is strange:
- The value in Settings -> Editor -> wxSmith -> Use i18N for strings looks like a global enable for translation.
- Each wxs file has its own setting (chosen when creating the resource in the Advanced options tab) and is not modifiable without editing the CBP file.
Both settings are ANDed in wxscodinglang.cpp:185, if the result is true then the string is surrounded with _(), if not with the value selected in Settings -> Non i18N strings.
This behaviour is unexpected and should be clarified, probably Use i18N for strings should be changed to Enable i18N globally or similar wording.