Source text encoding problems in G4processes

It seems the code and comment have inconsistent encoding currently as of 4.11.0.3. Newly added low-end electromagnetic processes (G4ANSTOecpssrKxsModel.hh etc) on comment header line have special latin character in windows-1252 code page (central europe and us?):

//  - S. Bakr et al. (2021) NIM B, 507:11–19.

The sequence of bytes is not valid in utf-8.
If /source-charset:windows-1252 is specified in cmake cxx flags on windows, the lines with °°° will evaluate to °°°.

Suggested fix would be chage the to a normal ascii -, conssistent with the next line:

//  - S. Bakr et al (2018), NIMB B, 436: 285-291. 

lines with °°° are typically:

            G4cout << "°°° G4DNAPTBExcitationModel - XS INFO START" << G4endl;

Same thing in G4INCLXXInterface.cc string literal description:

The Liège Intranuclear Cascade (INCL++)

In utf-8, this got evaluated to

The Li�ge Intranuclear Cascade (INCL++)

Complete code:

void G4INCLXXInterface::ModelDescription(std::ostream& outFile) const {
   outFile
     << "The Liège Intranuclear Cascade (INCL++) is a model for reactions induced\n"
     << "by nucleons, pions and light ion on any nucleus. The reaction is\n"
     << "described as an avalanche of binary nucleon-nucleon collisions, which can\n"
     << "lead to the emission of energetic particles and to the formation of an\n"
     << "excited thermalised nucleus (remnant). The de-excitation of the remnant is\n"
     << "outside the scope of INCL++ and is typically described by another model.\n\n"
     << "INCL++ has been reasonably well tested for nucleon (~50 MeV to ~15 GeV),\n"
     << "pion (idem) and light-ion projectiles (up to A=18, ~10A MeV to 1A GeV).\n"
     << "Most tests involved target nuclei close to the stability valley, with\n"
     << "numbers between 4 and 250.\n\n"
     << "Reference: D. Mancusi et al., Phys. Rev. C90 (2014) 054602\n\n";
}
1 Like

G4Fancy3DNucleus.cc uses no-break space (\u00A0) in exception description:

G4ExceptionDescription ed;
                  ed << "Nucleus Z A " << myZ << " " << myA << G4endl;
                  ed << "proton with eMax=" << eMax << G4endl;

and that character may not be present in other code page (e.g. chinese cp936), but I suppose that is not really important…

I will give a look into this.
Kind Regards
Susanna Guatelli

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.