Fluorohydride / ygopro

A script engine for "yu-gi-oh!" and sample gui
GNU General Public License v2.0
1.85k stars 596 forks source link

add EncodeUTF8String, DecodeUTF8String #2553

Closed salix5 closed 6 months ago

salix5 commented 6 months ago

Change the function definitions to:

static int EncodeUTF8String(const wchar_t* wsrc, char* str, int size);
template<size_t N>
static int EncodeUTF8(const wchar_t* src, char(&dst)[N]);

static int DecodeUTF8String(const char* src, wchar_t* wstr, int size);
template<size_t N>
static int DecodeUTF8(const char* src, wchar_t(&dst)[N]);

Now the arguments can be pointer as before. The files in gframe still use EncodeUTF8, DecodeUTF8.

@mercury233 @purerosefallen