Author Topic: Use of '_T("...")' with 'CB'  (Read 4350 times)

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 599
  • L'ami de l'homme. The friend of man.
    • LETARTARE
Use of '_T("...")' with 'CB'
« on: August 28, 2026, 04:12:37 pm »
I just compiled only 'cb-13984' and found 2638 strings '_T("...")' !! (without plugins)
However, since 'wx-3.0' this writing is obsolete.

What would be the advice to gradually delete this writing and how?

As for me, I think research on every target could be a lead.
CB-13991, plugins-sdk-2.26.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 599
  • L'ami de l'homme. The friend of man.
    • LETARTARE
Re: Use of '_T("...")' with 'CB'
« Reply #1 on: August 28, 2026, 04:20:39 pm »
Note :
'_T("")' => 'wxEmptyString'
CB-13991, plugins-sdk-2.26.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1911
Re: Use of '_T("...")' with 'CB'
« Reply #2 on: August 28, 2026, 04:40:35 pm »
I delete them as I pass near (see 13984), but some areas may be tricky (for example, parts of wxSmith creating string arrays).

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 599
  • L'ami de l'homme. The friend of man.
    • LETARTARE
Re: Use of '_T("...")' with 'CB'
« Reply #3 on: August 28, 2026, 06:39:21 pm »
I just dropped off three tickets: 1632, 1633, 1634
CB-13991, plugins-sdk-2.26.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 599
  • L'ami de l'homme. The friend of man.
    • LETARTARE
Re: Use of '_T("...")' with 'CB'
« Reply #4 on: Today at 11:38:28 am »
I just provided three fixes (1636, 1637, 1638) to replace
 
Code
'_T("...")' or  'wxT("...")' by '"..."'
for 'autosave', 'classwizard', codecompletion' plugins
CB-13991, plugins-sdk-2.26.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 599
  • L'ami de l'homme. The friend of man.
    • LETARTARE
Re: Use of '_T("...")' with 'CB'
« Reply #5 on: Today at 12:15:36 pm »
For those who are interested in research:

Here is the regular expression to use for '_T(' in 'CB'
Research :
Code
 '_T\(("(\\"|[^"])*")\)'
Replace :
Code
'\1'
Note : the ' must not be written
CB-13991, plugins-sdk-2.26.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

Offline gd_on

  • Lives here!
  • ****
  • Posts: 864
Re: Use of '_T("...")' with 'CB'
« Reply #6 on: Today at 04:48:15 pm »
Problem with svn 13991.
Apparently, at least in parserthread.cpp, some strings have been changed inside the ?: operator. This does not work.
Windows 11 64 bits (25H2), svn C::B (last version or almost!), wxWidgets 3.3.3, Msys2 Compilers 16.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 599
  • L'ami de l'homme. The friend of man.
    • LETARTARE
Re: Use of '_T("...")' with 'CB'
« Reply #7 on: Today at 04:55:35 pm »
I look immediately...
CB-13991, plugins-sdk-2.26.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1911
Re: Use of '_T("...")' with 'CB'
« Reply #8 on: Today at 05:10:05 pm »
Are these errors inside calls to TRACE()?

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 599
  • L'ami de l'homme. The friend of man.
    • LETARTARE
Re: Use of '_T("...")' with 'CB'
« Reply #9 on: Today at 05:11:28 pm »
@gd_on
Could you tell me the line or the lines involved ?

Because under 'Leap-15.6, gcc-15.2' I can't find any error in 'parserthread.cpp' when compiling.
CB-13991, plugins-sdk-2.26.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

Offline gd_on

  • Lives here!
  • ****
  • Posts: 864
Re: Use of '_T("...")' with 'CB'
« Reply #10 on: Today at 05:27:43 pm »
Yes, all problems are in TRACE : lines 1473, 2347, 2357, 2371, 3200, 3258
Example :
Code
C:\Users\Gerard\Documents\CodeBlocks_SVN\CodeBlocks_src\src\plugins\codecompletion\parser\parserthread.cpp|3258|error: conditional expression between distinct pointer types 'const wxStringCharType*' {aka 'const wchar_t*'} and 'const char*' lacks a cast|
May be there are other problems, but the compiler stops there in parserthread.
Windows 11 64 bits (25H2), svn C::B (last version or almost!), wxWidgets 3.3.3, Msys2 Compilers 16.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1911
Re: Use of '_T("...")' with 'CB'
« Reply #11 on: Today at 05:30:38 pm »
Sacre bleu!   ;D

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 599
  • L'ami de l'homme. The friend of man.
    • LETARTARE
Re: Use of '_T("...")' with 'CB'
« Reply #12 on: Today at 05:53:28 pm »
@gd_on

Can you try to replace "...." => wxS(".....") or wxString(".....") on these lines ?
CB-13991, plugins-sdk-2.26.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1911
Re: Use of '_T("...")' with 'CB'
« Reply #13 on: Today at 05:59:51 pm »
Quote
Yes, all problems are in TRACE : lines 1473, 2347, 2357, 2371, 3200, 3258

Reverted r13991 in these lines, see r13994. Please try to compile again.

I do not know why LETARTARE and I do not get compilation errors while gd_on does.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 864
Re: Use of '_T("...")' with 'CB'
« Reply #14 on: Today at 06:11:56 pm »
Probably better, but that time an other error still with TRACE :
Code
C:\Users\Gerard\Documents\CodeBlocks_SVN\CodeBlocks_src\src\plugins\codecompletion\parser\parserthread.cpp|2991|error: 'kkm_LastUnnamedTokenName' was not declared in this scope; did you mean 'm_LastUnnamedTokenName'?|
Apparently just kkm_ instead of m_
Windows 11 64 bits (25H2), svn C::B (last version or almost!), wxWidgets 3.3.3, Msys2 Compilers 16.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).