In my opinion
308: setlocale(LC_CTYPE, ""); /* To get right sortorder */
is really obsolete.
Database users typically have no concerns about locale on the server, if they need right sort order, they specify collations.

[26 Apr 2008 0:19]
Bugs System

A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:
http://lists.mysql.com/commits/46058
ChangeSet@1.2573, 2008-04-26 02:19:18+02:00, vvaintroub@wva. +1 -0
Bug#36279 - mysql built with Visual Studio 2005 does not display
japanese characters.
Fix - removed setlocale from my_init.c . In MBCS environments
it caused unwanted character-to-byte translations in fputc()
in client code and wrong output as result.

[10 Nov 2008 20:18]
Bugs System

A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:
http://lists.mysql.com/commits/58372
2711 Vladislav Vaintroub 2008-11-10
Bug#36279 - mysql built with Visual Studio 2005 does not display
japanese characters.
Fix - removed obsolvete setlocale from my_init.c . In MBCS
environments it caused unwanted character-to-byte translations
in fputc() in client code and wrong output as result.