Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid UTF-8 characters in result files #110

Open
Luthaf opened this issue Jul 29, 2020 · 0 comments
Open

Invalid UTF-8 characters in result files #110

Luthaf opened this issue Jul 29, 2020 · 0 comments
Labels

Comments

@Luthaf
Copy link

Luthaf commented Jul 29, 2020

Running the example simulation with mpiexec -n 2 Excimontec.exe parameters_default.txt results in results0.txt looking like this:

Excimontec v1.0.0-rc.4 Results:
Calculation time elapsed is 0.0166667 minutes.
8.98174e-05 seconds have been simulated.
44426 events have been executed.

Exciton diffusion test results:
100 excitons have been created.
Exciton diffusion length is 23.3244 � 15.0653 nm.
Exciton hop distance is 1.60557 � 1.52862 nm.
Exciton lifetime is 5.35038e-10 � 4.51257e-10 s.

There are three invalid UTF-8 values, as confirmed by iconv -f UTF-8 results0.txt > /dev/null; echo $? returning iconv: results0.txt:8:36: cannot convert. These seems to be set in

Excimontec/src/main.cpp

Lines 290 to 292 in df5a37f

resultsfile << "Exciton diffusion length is " << vector_avg(sim.getExcitonDiffusionData()) << " ± " << vector_stdev(sim.getExcitonDiffusionData()) << " nm.\n";
resultsfile << "Exciton hop distance is " << vector_avg(sim.getExcitonHopLengthData()) << " ± " << vector_stdev(sim.getExcitonHopLengthData()) << " nm.\n";
resultsfile << "Exciton lifetime is " << vector_avg(sim.getExcitonLifetimeData()) << " ± " << vector_stdev(sim.getExcitonLifetimeData()) << " s.\n";
.

The file looks fine using CP-1252 encoding, so I guess that would be the one you used. Most Unix OS do not use this encoding by default, so Linux users will not see these characters.

On the other hand, nowadays UTF-8 is pretty well supported on Windows, so changing everything to UTF-8 should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants