Author Topic: Editing/opening Lua files bug  (Read 8135 times)

Offline Indrekis

  • Multiple posting newcomer
  • *
  • Posts: 31
Editing/opening Lua files bug
« on: October 09, 2007, 09:48:45 pm »
Hello, All!

I have encountered an interesting bug.
For lua files with enabled syntax highlighting, letter "К" (from cyrillic alphabet, in Win1251 has code 0CAh), completely hangs Code::Blocks. This occurs when "К" is typed in and then saved, or a lua file, which contains this letter is opened. It looks like position of the letter in the file does not matter.
For C/C++ files this letter do not cause any problems. When lua syntax highlighting is disabled, the problem does not persist too. I am not sure that only this cyrillic symbol hang CB.

This letter does not cause any problems for SciTE 1.67 with Lua highlights.

"Tested" in several revisions between 4410 and 4517. Exist both in self-compiled CB and in nightly builds. My OS - WindowsXP SP2.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7791
    • My Best Post
Re: Editing/opening Lua files bug
« Reply #1 on: October 10, 2007, 01:32:29 am »
I have no idea if it makes a difference, but what is
"Settings" -> "Editor" value for "default encoding when opening files" set to?

You might try different setting and reopen the file and test adding the letter again.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Indrekis

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Editing/opening Lua files bug
« Reply #2 on: October 10, 2007, 01:58:45 am »
It was set to Windows-1251.
After changing it to something other CB hang during opening lua file with the letter too.

Later I set it to UTF-8, entered the letter and saved the file. CB hangs. File become converted to UTF-8 (UTF-8 code of "К" is D0h 9Ah, or U+041A). After restarting CB I opened the file. CB hanged again.

Note: The hang occurs somewhere after the file is saved - file remains intact and contains latest changes.
« Last Edit: October 10, 2007, 02:02:37 am by Indrekis »

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Editing/opening Lua files bug
« Reply #3 on: October 10, 2007, 04:20:06 am »
It was set to Windows-1251.
After changing it to something other CB hang during opening lua file with the letter too.

Later I set it to UTF-8, entered the letter and saved the file. CB hangs. File become converted to UTF-8 (UTF-8 code of "К" is D0h 9Ah, or U+041A). After restarting CB I opened the file. CB hanged again.

Note: The hang occurs somewhere after the file is saved - file remains intact and contains latest changes.

This is a well-known problem. At the moment, C::B can support upto UTF-8. But Code-completion (CC) hangs. And sometimes the file load routine (with character set conversion) hangs, too.

I have overhauled the Unicode support of C::B in terms of File Load (with auto-detection) and Saving. But at the moment I can't apply the patch as CC will then hang C::B.

If you want to work with a UTF-8 file on Windows, try to disable CC.
« Last Edit: October 10, 2007, 04:26:44 am by Biplab »
Be a part of the solution, not a part of the problem.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Editing/opening Lua files bug
« Reply #4 on: October 10, 2007, 09:03:05 am »
If you want to work with a UTF-8 file on Windows, try to disable CC.
Or maybe we should just fix the issues we had pinpointed - remember? ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Editing/opening Lua files bug
« Reply #5 on: October 10, 2007, 10:27:19 am »
If you want to work with a UTF-8 file on Windows, try to disable CC.
Or maybe we should just fix the issues we had pinpointed - remember? ;-)

Yes. We should. :)
Be a part of the solution, not a part of the problem.

Offline Indrekis

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Editing/opening Lua files bug
« Reply #6 on: October 10, 2007, 10:37:08 am »
Biplab, thank you for your answer, disabling code completion plugin helped  :)

If you want to work with a UTF-8 file on Windows, try to disable CC.
Though, I must admit, that problem was encountered, while using Win-1251 and only for lua files and only for this letter. At least all is OK for C/C++ files and several other cyrillic letters in lua files.

UTF-8 appeared just during investigations, performed after stahta01 suggestion.


Biplab, I am sorry, I've misapprehend your phrase "And sometimes the file load routine (with character set conversion) hangs, too". Because of it second part of my comment is inappropriate.
« Last Edit: October 25, 2007, 02:53:22 am by Indrekis »

Offline Indrekis

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Editing/opening Lua files bug
« Reply #7 on: October 25, 2007, 02:56:50 am »
As of revision 4551 everything is OK

Many thanks to the developers!

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Editing/opening Lua files bug
« Reply #8 on: October 25, 2007, 05:33:38 am »
As of revision 4551 everything is OK

Many thanks to the developers!

Nice to know that it works. Please upgrade to 4554 as it would fix one possible detection issue. :)
Be a part of the solution, not a part of the problem.