Menu

#1506 const char *complexCaseConversions cannot be compiled properly

Bug
closed-fixed
5
2013-08-31
2013-07-30
BLUEnLIVE
No

const char *complexCaseConversions (in CaseConvert.cxx) is a long string.
BTW, it seems not be compiled properly in my language environment.

I think you'd better change it to "\x0000" format.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2013-07-30

    The string is in the current format because it allows visual inspection for errors. Using \x escapes would obscure the meaning. The current format is also smaller.

    Which compiler is not working? If there is an error message, what does it say?

     
  • Neil Hodgson

    Neil Hodgson - 2013-07-30
    • labels: complexCaseConversions --> complexCaseConversions, scintilla
    • assigned_to: Neil Hodgson
     
  • BLUEnLIVE

    BLUEnLIVE - 2013-07-30

    I found that problem compiling and using Notepad2-mod(http://xhmikosr.github.io/notepad2-mod/).
    And newest version(4.2.25.870) uses Scintilla v3.3.4. (CaseConvert.cxx is added in this version)

    I use WDK and VC++2010 Express.
    Both of them compile successfully, but, when I use find/replace function it crashes.
    And, VC debugger told that function crashes.

    BTW, official build by XhmikosR doesn't crashes.
    Could different language environment cause that problem?

    Hmmm.....
    I wrote "not be compiled properly"...
    Sorry for confusion.

     
  • Neil Hodgson

    Neil Hodgson - 2013-07-30

    You should find the simplest case that causes a crash and report the document text, search string, encoding, and search options.

     
  • BLUEnLIVE

    BLUEnLIVE - 2013-07-30

    It's weired...
    When compiled in my language(Korean) environment it happens always. (WDK and VS2010Exp)
    But, officially released notepad2-mod doesn't crashes.

    I post notepad2.exe and test.txt.
    You can see the problem.
    Just find any string.

    Thanks for reading.

     
    • Neil Hodgson

      Neil Hodgson - 2013-07-30

      It also hangs if the search is case-sensitive which shouldn't call the CaseConvert module.

      I can't reproduce the hang with SciTE using VS2010 Express with an Australian English locale. You could try debugging the actual hang by placing a breakpoint at the start of the failing function and tracing execution.

       
  • XhmikosR

    XhmikosR - 2013-07-30

    @Neil: my locale is Greek and I do get a compiler warning using VS2012 but the build apparently works fine:

    src\CaseConvert.cxx : warning C4819: The file contains a character that cannot be represented in the current code page (1253). Save the file in Unicode format to prevent data loss [H:\progs\Compiling\notepad2-mod\scintilla\Scintilla.vcxproj]

    The weird thing is that CaseConvert.css is already UTF-8. I tried with BOM but the warnings are many more.

    Also, with Intel compiler 2013 I get more meaningful warnings:

    src\CaseConvert.cxx(288): warning #913: invalid multibyte character sequence [H:\progs\Compiling\notepad2-mod\scintilla\Scintilla_icl13.vcxproj]
        "ά╛Τ|ά╝λ╬╣|ά╝ς╬β||"
                     ^
    
    src\CaseConvert.cxx(296): warning #913: invalid multibyte character sequence [H:\progs\Compiling\notepad2-mod\scintilla\Scintilla_icl13.vcxproj]
        "ά╛γ|ά╝λ╬╣|ά╝ς╬β|ά╛Τ|"
                     ^
    
    src\CaseConvert.cxx(304): warning #913: invalid multibyte character sequence [H:\progs\Compiling\notepad2-mod\scintilla\Scintilla_icl13.vcxproj]
        "ά╛λ|ά╜λ╬╣|ά╜ς╬β||"
                     ^
    
    src\CaseConvert.cxx(312): warning #913: invalid multibyte character sequence [H:\progs\Compiling\notepad2-mod\scintilla\Scintilla_icl13.vcxproj]
        "ά╛ς|ά╜λ╬╣|ά╜ς╬β|ά╛λ|"
           ^
    
    src\CaseConvert.cxx(312): warning #913: invalid multibyte character sequence [H:\progs\Compiling\notepad2-mod\scintilla\Scintilla_icl13.vcxproj]
        "ά╛ς|ά╜λ╬╣|ά╜ς╬β|ά╛λ|"
                     ^
    
    src\CaseConvert.cxx(347): warning #913: invalid multibyte character sequence [H:\progs\Compiling\notepad2-mod\scintilla\Scintilla_icl13.vcxproj]
        "έΕς|k||k|"
           ^
    

    I hope this helps.

     

    Last edit: XhmikosR 2013-07-30
  • BLUEnLIVE

    BLUEnLIVE - 2013-07-31

    I compared *complexCaseConversions from my build with same one from yours.
    And, I found they are different.

    Attached file "extracted_my_notepad2" is extracted from my build(in Korean code page: 949)
    And, "extracted_from_scilexer_or_notepad2" is from official notepad-mod and/or scilexer.dll.

    There are lots of "?"(0x3f) in my build.
    And I's sure, it means "There is lots of chars which cannot be converted from unicode".

    You can see the difference at attached "comparison.png"

    To create same result at any code page, I recommend you to change *complexCaseConversions in CaseConvert.cxx to attached "CaseConvert_edited.cxx"

    It is created from "extracted_from_scilexer_or_notepad2"

    And... Thanks for reading my poor English and testing, both of you. ;)

     

    Last edit: BLUEnLIVE 2013-07-31
  • Neil Hodgson

    Neil Hodgson - 2013-07-31

    Committed fix as [845df8].

     

    Related

    Commit: [845df8]

  • Neil Hodgson

    Neil Hodgson - 2013-07-31
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2013-08-31
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.