Bug #14134 2008-07-05 01:27

jimp

Encoding of "default" Causes Crash

Using CodeBlocks version CodeBlocks 8.02.

In Settings > Editor, "default encoding when opening files" - setting the option to "default" causes the program to crash on the next execution.

After changing the setting to "default" the encoding in the status bar changes to "unknown-87". When re-starting CodeBlocks and opening a project, a dialog is displayed saying "The charset 'default' is unknown." The program then crashes instead of letting you select a new charset.

Changing the encoding from the edit menu seems to work OK but it is only a temporary change.

Also, in my opinion, the "default" option should be at the top of the editor settings list, not near the bottom. And it should be the CodeBlocks default setting instead of "UTF-8".

---------------------------------------------------------------------

A fix for not recognizing the default setting is in encodingdetector.cpp at line 229:

m_Encoding = fontmap.CharsetToEncoding(encname);

change to:

if (encname != _T("default"))

m_Encoding = fontmap.CharsetToEncoding(encname);

Since m_Encoding is already set to wxLocale::GetSystemEncoding() this will leave the encoding at the system default.

I didn't try to find the reason for the crash since the above fix solved my immediate problem.

Category
Application::Crash
Group
 
Status
Closed
Close date
2008-08-31 09:42
Assigned to
biplab
biplab 2008-08-16 06:07

Sorry, but I can't reproduce. Any additional information? Does it

still persist?

jimp 2008-08-18 02:23

Tried again using CodeBlocks SNV 5188 from 8-17-08. It works OK now.

Thanks,

jimp

biplab 2008-08-31 09:42

Closed on user-feedback.