[fixed]CGUITable::deserialize() doesn't use correct string getter
Posted: Sun Apr 24, 2022 8:53 am
In my problems here [link]viewtopic.php?f=6&p=306532#p306532[/link], I inadvertently discovered that part of the reason Asian text doesn't show up is because getAttributeAsString() is being used where stringw is sought.
Code from line 1255 of CGUITable.cpp (of rev 6221):
Should be:
This allows getAttributeAsStringW() to secretly perform any conversion from char to wchar_t if the string to be returned isn't already wchar_t.
I'm guessing the original code was probably written before there was a getAttributeAsStringW().
I checked the other GUI elements, and all but one other were fine. CGUIFileOpenDialog uses getAttributeAsString() regardless of platform. Should be stringw on Windows I would think, but then again it should be io::path for fschar_t, lol. Easiest thing would be to use the #ifdef _IRR_WCHAR_FILESYSTEM
I'm tired and going to bed.
Code from line 1255 of CGUITable.cpp (of rev 6221):
Code: Select all
cell.Text = core::stringw(in->getAttributeAsString(label.c_str()).c_str());
Code: Select all
cell.Text = in->getAttributeAsStringW(label.c_str());
I'm guessing the original code was probably written before there was a getAttributeAsStringW().
I checked the other GUI elements, and all but one other were fine. CGUIFileOpenDialog uses getAttributeAsString() regardless of platform. Should be stringw on Windows I would think, but then again it should be io::path for fschar_t, lol. Easiest thing would be to use the #ifdef _IRR_WCHAR_FILESYSTEM
I'm tired and going to bed.