Right now your code is essentially using memory copies when converting from a U*
to String<T>
. That's unfortunately not going to work because wchar_t
and char
have different memory layouts. In particular a wchar_t
usually takes up 2 bytes while char
is a single byte
. What you need to establish here is a proper conversion function which should be applied to every item in the string
T ConvertChar(U c) { ... }