On Thu, Apr 29, 2021 at 4:50 PM edgar <edgar...@cryptolab.net> wrote:
> Dear list, > > I noticed that if I have a GetPot file such as: > > ┌──── > │ [./ó] > │ val = 1 > │ [../] > └──── > > , that my program would crash. As soon as I change `ó' by `o', it works > fine. This makes me think that the crash arises because of this line in > getpot.h > > ┌──── > │ str += getpot_cast_int<char>(tmp); > └──── > > which is #define'd in getpot.h > > ┌──── > | #define getpot_cast_int libMesh::cast_int > └──── > > and goes back to libmesh_common.h > > ┌──── > │ template <typename Tnew, typename Told> > │ inline Tnew cast_int (Told oldvar) > │ { > │ libmesh_assert_equal_to > │ (oldvar, static_cast<Told>(static_cast<Tnew>(oldvar))); > │ > │ return(static_cast<Tnew>(oldvar)); > │ } > └──── > > It seems that only int-equivalent (i.e. 8-bit) characters are allowed in > the GetPot file, is that correct? Is there support for UTF-x? (x: a > number base, e.g. 8, 16, etc.) > Yeah, I think you've pretty well shown that GetPot only supports ASCII files. I actually don't know how hard it would be to generalize it to use wchar or something, but the next problem would be that libmesh itself uses only std::strings everywhere, so updating GetPot would likely only be the tip of the iceberg of changes that would be required to fully support UTF-8. -- John _______________________________________________ Libmesh-users mailing list Libmesh-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-users