- Home /
Question by
jpthek9 · May 31, 2015 at 12:02 AM ·
playerprefsstringencoding
PlayerPrefs not storing string?
I need to use PlayerPrefs to store arrays of bytes for my game. For some reason, the string I save with PlayerPrefs doesn't come out with the same in length.
I.e.
byte[] TestArray = new byte[256];
for (byte i = 0; i < 256; i++)
{
TestArray[i] = i;
}
char[] charBuffer = new char[256];
PlayerPrefs.SetString ("Storage", new string(charBuffer));
PlayerPrefs.Save ();
Debug.Log (new String(charBuffer).Length);
Debug.Log (PlayerPrefs.GetString ("Storage").Length);
Log:
256
5
Is this possibly an issue with encoding?
Comment
Your answer
Follow this Question
Related Questions
How can I convert UTF8 string to arabic? 2 Answers
PlayerPrefs for saving strings 1 Answer
PlayerPrefs script problem 2 Answers
Does saving byte stream to PlayerPrefs need Base64 conversion? 1 Answer