CS:GO implements it like this: ```cpp // write { int nLength = dat->m_wsValue ? V_wcslen( dat->m_wsValue ) : 0; buffer.PutShort( nLength ); for( int k = 0; k < nLength; ++ k ) { buffer.PutShort( ( unsigned short ) dat->m_wsValue[k] ); } break; } // read { int nLength = buffer.GetShort(); dat->m_wsValue = new wchar_t[nLength + 1]; for( int k = 0; k < nLength; ++ k ) { dat->m_wsValue[k] = buffer.GetShort(); } dat->m_wsValue[ nLength ] = 0; break; } ```
Activity
yaakov-h commentedon Jan 19, 2021
So its just two bytes for length and then two bytes per char?
Seems simple enough, particularly given that
charin .NET is already two bytes wide 😈