diff --git a/phreeqcpp/class_main.cpp b/phreeqcpp/class_main.cpp index 2ee57fc6..0ee58bd1 100644 --- a/phreeqcpp/class_main.cpp +++ b/phreeqcpp/class_main.cpp @@ -109,7 +109,10 @@ main_method(int argc, char *argv[]) { return errors; } +#ifndef NO_UTF8_ENCODING #ifdef DOS + SetConsoleOutputCP(CP_UTF8); +#endif write_banner(); #endif @@ -199,7 +202,10 @@ main_method(int argc, char *argv[]) { return errors; } +#ifndef NO_UTF8_ENCODING #ifdef DOS + SetConsoleOutputCP(CP_UTF8); +#endif write_banner(); #endif @@ -271,9 +277,9 @@ write_banner(void) char buffer[80]; int len, indent; screen_msg( - " ÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛ\n"); + " █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█\n"); screen_msg( - " º º\n"); + " â•‘ â•‘\n"); /* version */ #ifdef NPP @@ -282,21 +288,21 @@ write_banner(void) len = sprintf(buffer, "* PHREEQC-%s *", "@VERSION@"); #endif indent = (44 - len) / 2; - screen_msg(sformatf("%14cº%*c%s%*cº\n", ' ', indent, ' ', buffer, + screen_msg(sformatf("%14câ•‘%*c%s%*câ•‘\n", ' ', indent, ' ', buffer, 44 - indent - len, ' ')); screen_msg( - " º º\n"); + " â•‘ â•‘\n"); screen_msg( - " º A hydrogeochemical transport model º\n"); + " â•‘ A hydrogeochemical transport model â•‘\n"); screen_msg( - " º º\n"); + " â•‘ â•‘\n"); screen_msg( - " º by º\n"); + " â•‘ by â•‘\n"); screen_msg( - " º D.L. Parkhurst and C.A.J. Appelo º\n"); + " â•‘ D.L. Parkhurst and C.A.J. Appelo â•‘\n"); screen_msg( - " º º\n"); + " â•‘ â•‘\n"); /* date */ @@ -306,11 +312,11 @@ write_banner(void) len = sprintf(buffer, "%s", "@VER_DATE@"); #endif indent = (44 - len) / 2; - screen_msg(sformatf("%14cº%*c%s%*cº\n", ' ', indent, ' ', buffer, + screen_msg(sformatf("%14câ•‘%*c%s%*câ•‘\n", ' ', indent, ' ', buffer, 44 - indent - len, ' ')); screen_msg( - " ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ\n\n"); + " █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█\n\n"); return 0; } @@ -485,7 +491,7 @@ process_file_names(int argc, char *argv[], std::istream **db_cookie, } local_database_file->close(); delete local_database_file; - + user_database = (char *) free_check_null(user_database); user_database = string_duplicate(token); screen_msg(sformatf("Database file: %s\n\n", token)); diff --git a/phreeqcpp/print.cpp b/phreeqcpp/print.cpp index 49fc50b9..18ccd3b5 100644 --- a/phreeqcpp/print.cpp +++ b/phreeqcpp/print.cpp @@ -1483,7 +1483,7 @@ print_species(void) #ifdef NO_UTF8_ENCODING "Molality", "Activity", "Molality", "Activity", "Gamma", "cm3/mol")); #else - "Molality", "Activity", "Molality", "Activity", "Gamma", "cm³/mol")); + "Molality", "Activity", "Molality", "Activity", "Gamma", "cm³/mol")); #endif /* * Print list of species @@ -1651,7 +1651,7 @@ print_surface(void) #ifdef NO_UTF8_ENCODING output_msg(sformatf("\t%11.3e sigma, C/m2\n", #else - output_msg(sformatf("\t%11.3e sigma, C/m²\n", + output_msg(sformatf("\t%11.3e sigma, C/m²\n", #endif (double) (charge * F_C_MOL / (charge_ptr->Get_specific_area() * @@ -1662,7 +1662,7 @@ print_surface(void) #ifdef NO_UTF8_ENCODING output_msg(sformatf("\tundefined sigma, C/m2\n")); #else - output_msg(sformatf("\tundefined sigma, C/m²\n")); + output_msg(sformatf("\tundefined sigma, C/m²\n")); #endif } if (use.Get_surface_ptr()->Get_type() == cxxSurface::CCM) @@ -1684,7 +1684,7 @@ print_surface(void) #ifdef NO_UTF8_ENCODING "\t%11.3e specific area, m2/mol %s\n", #else - "\t%11.3e specific area, m²/mol %s\n", + "\t%11.3e specific area, m²/mol %s\n", #endif (double) charge_ptr->Get_specific_area(), comp_ptr->Get_phase_name().c_str())); @@ -1692,7 +1692,7 @@ print_surface(void) #ifdef NO_UTF8_ENCODING "\t%11.3e m2 for %11.3e moles of %s\n\n", #else - "\t%11.3e m² for %11.3e moles of %s\n\n", + "\t%11.3e m² for %11.3e moles of %s\n\n", #endif (double) (charge_ptr->Get_grams() * charge_ptr->Get_specific_area()), @@ -1705,7 +1705,7 @@ print_surface(void) #ifdef NO_UTF8_ENCODING "\t%11.3e specific area, m2/mol %s\n", #else - "\t%11.3e specific area, m²/mol %s\n", + "\t%11.3e specific area, m²/mol %s\n", #endif (double) charge_ptr->Get_specific_area(), comp_ptr->Get_rate_name().c_str())); @@ -1713,7 +1713,7 @@ print_surface(void) #ifdef NO_UTF8_ENCODING "\t%11.3e m2 for %11.3e moles of %s\n\n", #else - "\t%11.3e m² for %11.3e moles of %s\n\n", + "\t%11.3e m² for %11.3e moles of %s\n\n", #endif (double) (charge_ptr->Get_grams() * charge_ptr->Get_specific_area()), @@ -1726,13 +1726,13 @@ print_surface(void) #ifdef NO_UTF8_ENCODING "\t%11.3e specific area, m2/g\n", #else - "\t%11.3e specific area, m²/g\n", + "\t%11.3e specific area, m²/g\n", #endif (double) charge_ptr->Get_specific_area())); #ifdef NO_UTF8_ENCODING output_msg(sformatf("\t%11.3e m2 for %11.3e g\n\n", #else - output_msg(sformatf("\t%11.3e m² for %11.3e g\n\n", + output_msg(sformatf("\t%11.3e m² for %11.3e g\n\n", #endif (double) (charge_ptr->Get_specific_area() * charge_ptr->Get_grams()), @@ -1948,28 +1948,28 @@ print_surface_cd_music(void) #ifdef NO_UTF8_ENCODING "\t%11.3e sigma, plane 0, C/m2\n", #else - "\t%11.3e sigma, plane 0, C/m²\n", + "\t%11.3e sigma, plane 0, C/m²\n", #endif (double) charge_ptr->Get_sigma0())); output_msg(sformatf( #ifdef NO_UTF8_ENCODING "\t%11.3e sigma, plane 1, C/m2\n", #else - "\t%11.3e sigma, plane 1, C/m²\n", + "\t%11.3e sigma, plane 1, C/m²\n", #endif (double) charge_ptr->Get_sigma1())); output_msg(sformatf( #ifdef NO_UTF8_ENCODING "\t%11.3e sigma, plane 2, C/m2\n", #else - "\t%11.3e sigma, plane 2, C/m²\n", + "\t%11.3e sigma, plane 2, C/m²\n", #endif (double) charge_ptr->Get_sigma2())); output_msg(sformatf( #ifdef NO_UTF8_ENCODING "\t%11.3e sigma, diffuse layer, C/m2\n\n", #else - "\t%11.3e sigma, diffuse layer, C/m²\n\n", + "\t%11.3e sigma, diffuse layer, C/m²\n\n", #endif (double) charge_ptr->Get_sigmaddl())); } @@ -1978,7 +1978,7 @@ print_surface_cd_music(void) #ifdef NO_UTF8_ENCODING output_msg(sformatf("\tundefined sigma, C/m2\n")); #else - output_msg(sformatf("\tundefined sigma, C/m²\n")); + output_msg(sformatf("\tundefined sigma, C/m²\n")); #endif } output_msg(sformatf("\t%11.3e psi, plane 0, V\n", @@ -2236,7 +2236,7 @@ print_totals(void) #ifdef NO_UTF8_ENCODING "Specific Conductance (uS/cm, ", tc_x, "oC) = ", (int) SC)); #else - "Specific Conductance (µS/cm, ", tc_x, "°C) = ", (int) SC)); + "Specific Conductance (µS/cm, ", tc_x, "°C) = ", (int) SC)); #endif } /* VP: Density Start */ @@ -2246,7 +2246,7 @@ print_totals(void) #ifdef NO_UTF8_ENCODING output_msg(sformatf("%45s%9.5f", "Density (g/cm3) = ", #else - output_msg(sformatf("%45s%9.5f", "Density (g/cm³) = ", + output_msg(sformatf("%45s%9.5f", "Density (g/cm³) = ", #endif (double) dens)); if (state == INITIAL_SOLUTION && use.Get_solution_ptr()->Get_initial_data()->Get_calc_density()) @@ -2270,7 +2270,7 @@ print_totals(void) #ifdef NO_UTF8_ENCODING " (solute contributions limited to 200 oC)")); #else - " (solute contributions limited to 200 °C)")); + " (solute contributions limited to 200 °C)")); #endif } else output_msg(sformatf("\n")); @@ -2300,7 +2300,7 @@ print_totals(void) #ifdef NO_UTF8_ENCODING output_msg(sformatf("%45s%6.2f\n", "Temperature (oC) = ", #else - output_msg(sformatf("%45s%6.2f\n", "Temperature (°C) = ", + output_msg(sformatf("%45s%6.2f\n", "Temperature (°C) = ", #endif (double) tc_x)); diff --git a/phreeqcpp/transport.cpp b/phreeqcpp/transport.cpp index dffb6046..8684ba62 100644 --- a/phreeqcpp/transport.cpp +++ b/phreeqcpp/transport.cpp @@ -1,4 +1,4 @@ -#include "Utils.h" +#include "Utils.h" #include "Phreeqc.h" #include "phqalloc.h" #include "Exchange.h"