Author Topic: Fix for Chinese directories  (Read 11653 times)

Offline iq_132

  • Administrator
  • *****
  • Posts: 3732
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Fix for Chinese directories
« on: February 04, 2005, 01:42:53 PM »
This was posted on the FBA forums by Jan, and I thought I'd mirror it here (since most of you probably don't frequent that forum).

In cona.cpp (src/burner/win32/)

Find this:
Code: [Select]
if ((h = _tfopen(szConfig, _T("rt"))) == NULL) {
return 1;
}

and change it to this:
Code: [Select]
if ((h = _tfopen(szConfig, _T("rb"))) == NULL) {
return 1;
}

There's only one problem with this though... you can't manually edit the config file without some problems.

I think I may have to write something to make the directories stored in a different config file...
« Last Edit: May 10, 2005, 12:21:10 PM by iq_132 »


Offline pigcat

  • New Member
  • *
  • Posts: 1
  • Karma: +0/-0
  • Junior Member
Fix for Chinese directories
« Reply #1 on: February 04, 2005, 11:24:59 PM »
open src/burner/win32/main.cpp

---------------
find
#include "burner.h"

add after

#include

---------------
find
// Main program entry point
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int nShowCmd)
{

add after
   setlocale(LC_ALL, ("Chinese_China"));

-------------

咳,英文不好,不过这里是有些国人的,在琵琶行那边看到一帮人讨论这个问题很久也没得要领,不过那边禁止注册了,看他们郁闷的不行,我是想告诉他们该怎么做也告不成。

这个问题是由于使用了_UNICODE定义,编译时的c-runtime库就会使用fprintf这类函数的unicode版本,所以在使用这些函数之前,要先用setlocale设置本地化标记,才能使这些unicode版本的函数正常处理多字节. :D

Offline netbug

  • Newbies
  • *
  • Posts: 37
  • Karma: +1/-0
  • Member
Fix for Chinese directories
« Reply #2 on: February 05, 2005, 12:09:27 AM »
呵呵……我也用中文来说一个bug,
在neo_run.cpp中主要应用于svcboot驱动系列。和fba不认长的声音文件名比如5003-v1
bug in loading Sound data in neo_run.cpp


find:
if (pInfo->nADPCMBNum == 0) {
nYM2610ADPCMASize *= pName[FindType(pName) + 1] - '1';
} else {
nYM2610ADPCMASize *= pName[FindType(pName) + 2] - '1';
}


replace with :
/*
if (pInfo->nADPCMBNum == 0) {
nYM2610ADPCMASize *= pName[FindType(pName) + 1] - '1';
} else {
nYM2610ADPCMASize *= pName[FindType(pName) + 2] - '1';
}*/

if ((!strcmp(BurnDrvGetTextA(DRV_NAME), "pbobblen")) || (!strcmp(BurnDrvGetTextA(DRV_NAME), "pbobblna"))) {
nYM2610ADPCMASize *= 3;
} else {
nYM2610ADPCMASize *=pInfo->nADPCMANum-1;
}

Offline netbug

  • Newbies
  • *
  • Posts: 37
  • Karma: +1/-0
  • Member
Fix for Chinese directories
« Reply #3 on: February 05, 2005, 12:17:36 AM »
//for instance 应用举例
// SvC Chaos: SNK vs Capcom (bootleg) 格斗之王对街头霸王:混沌版 (盗版)

static struct BurnRomInfo svcbootRomDesc[] = {
    {"svc-p1.bin", 0x800000, 0x0348F162, 1 | BRF_ESS | BRF_PRG},   // 0 68K code

    {"svc-s1.bin", 0x020000, 0x70B44DF1, 2 | BRF_GRA},   // 1

    {"svc-c1.bin", 0x800000, 0xA7826B89, 3 | BRF_GRA},   // 2 Sprite data
    {"svc-c2.bin", 0x800000, 0xED3C2089, 3 | BRF_GRA},   // 3
    {"svc-c3.bin", 0x800000, 0x71ED8063, 3 | BRF_GRA},   // 4
    {"svc-c4.bin", 0x800000, 0x250BDE2D, 3 | BRF_GRA},   // 5
    {"svc-c5.bin", 0x800000, 0x9817C082, 3 | BRF_GRA},   // 6
    {"svc-c6.bin", 0x800000, 0x2BC0307F, 3 | BRF_GRA},   // 7
    {"svc-c7.bin", 0x800000, 0x4358D7B9, 3 | BRF_GRA},   // 8
    {"svc-c8.bin", 0x800000, 0x366DEEE5, 3 | BRF_GRA},   // 9

    {"svc-m1.bin", 0x020000, 0x804328C3, 4 | BRF_ESS | BRF_PRG},   // 10 Z80 code

    {"svc-v2.bin", 0x400000, 0xB5097287, 5 | BRF_SND},   // 11
    {"svc-v1.bin", 0x400000, 0xBD3A391F, 5 | BRF_SND},   // 12 Sound data
    {"svc-v4.bin", 0x400000, 0x33FC0B37, 5 | BRF_SND},   // 13
    {"svc-v3.bin", 0x400000, 0xAA9849A0, 5 | BRF_SND},   // 14
};

STDROMPICKEXT(svcboot, svcboot, neogeo);
STD_ROM_FN(svcboot);

static void svcboot_c()
{
  const unsigned char idx_tbl[ 0x10 ] = {
       0, 1, 0, 1, 2, 3, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5,
    };

   const unsigned char bitswap4_tbl[ 6 ][ 4 ] = {
      { 3, 0, 1, 2 },
      { 2, 3, 0, 1 },
      { 1, 2, 3, 0 },
      { 0, 1, 2, 3 },
      { 3, 2, 1, 0 },
      { 3, 0, 2, 1 },
    };

   int i,ofst,crom_size = 0x4000000;
   UINT8 *crom = NeoSpriteROM;
   UINT8 *buf = (UINT8*)malloc(crom_size);

   memcpy( buf, crom, crom_size );

   for( i = 0; i < crom_size / 0x80; i++ ){
      int idx = idx_tbl[ (i & 0xf00) >> 8 ];

      int bit0 = bitswap4_tbl[ idx ][ 0 ];
      int bit1 = bitswap4_tbl[ idx ][ 1 ];
      int bit2 = bitswap4_tbl[ idx ][ 2 ];
      int bit3 = bitswap4_tbl[ idx ][ 3 ];

      ofst = BITSWAP08( (i & 0x0000ff), 7, 6, 5, 4, bit3, bit2, bit1, bit0 );
      ofst += (i & 0xfffff00);

      memcpy( &crom[ i * 0x80 ], &buf[ ofst * 0x80 ], 0x80 );
   }

   free( buf );

  // nSaveBootlegDecryptedC = 1; //for saving decrypted Sprite data 保存解密的盗版图像文件
}

static void svcboot_mx_decrypt()
{
   UINT8 *mrom = (UINT8 *)(NeoZ80ROM);
   UINT8 *dst = (UINT8*)malloc(0x20000);
   memcpy( dst+0x00000, mrom+0x10000, 0x10000 );
   memcpy( dst+0x10000, mrom+0x00000, 0x10000 );
   memcpy( mrom,dst,0x20000 );
   free(dst);

          //声音文件位交换
       nADPCMByteswap = 2;
}

static void svcboot_decrypt()
{
   const unsigned char sec[] = {0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00};

   int i,ofst,rom_size = 0x800000;

   UINT8 *rom = (UINT8*)(Neo68KROM);
   UINT8 *buf = (UINT8*)malloc(rom_size);

    for( i = 0; i < rom_size / 0x100000; i++ ){
      memcpy( &buf[ i * 0x100000 ], &rom[ sec[ i ] * 0x100000 ], 0x100000 );
    }

    for( i = 0; i < rom_size / 2; i++ ){
      ofst = BITSWAP08( (i & 0x0000ff), 7, 6, 1, 0, 3, 2, 5, 4 );
      ofst += (i & 0xffff00);
       memcpy( &rom[ i * 2 ], &buf[ ofst * 2 ], 0x02 );
    }

   free(buf);
   
   svcboot_mx_decrypt();
   
   svcboot_c();
}

static int svcbootInit()
{
   pNeoInitCallback=svcboot_decrypt;
   
   nNeoTextROMFixType=3;
   
  memset(CartRAM,0,sizeof(CartRAM));
 
  int nRet=NeoInit();
  if(!nRet)
      mv0_BankMapHandler();
   return nRet;
}

struct BurnDriver BurnDrvsvcboot= {
   "svcboot",NULL, "neogeo", "2003",
   "SvC Chaos: SNK vs Capcom (bootleg)\0格斗之王对街头霸王:混沌版 (盗版)\0图像、声音盗版加密\0",NULL,"SNK Playmore公司", "Neo Geo",
   NULL, NULL, NULL, NULL,
  BDF_GAME_WORKING | BDF_BOOTLEG, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CUSTOM_BANKING | HARDWARE_SNK_SRAM,
  NULL, svcbootRomInfo, svcbootRomName, neogeoInputInfo, neogeoDIPInfo,
  svcbootInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
  nNeoScreenWidth, 224, 4, 3
};


// SvC Chaos: SNK vs Capcom Super Plus! (hack) 格斗之王对街头霸王:混沌版超级加强 (盗版)

static struct BurnRomInfo svcsplusRomDesc[] = {
    {"svc-p1sp.bin",0x400000, 0x2601902F, 1 | BRF_ESS | BRF_PRG},   // 0 68K code
    {"svc-p2sp.bin",0x400000, 0x0CA13305, 1 | BRF_ESS | BRF_PRG},   // 1

    {"svc-s1sp.bin",0x020000, 0x233D6439, 2 | BRF_GRA},   // 2

    {"svc-c1.bin",  0x800000, 0xA7826B89, 3 | BRF_GRA},   // 3 Sprite data
    {"svc-c2.bin",  0x800000, 0xED3C2089, 3 | BRF_GRA},   // 4
    {"svc-c3.bin",  0x800000, 0x71ED8063, 3 | BRF_GRA},   // 5
    {"svc-c4.bin",  0x800000, 0x250BDE2D, 3 | BRF_GRA},   // 6
    {"svc-c5.bin",  0x800000, 0x9817C082, 3 | BRF_GRA},   // 7
    {"svc-c6.bin",  0x800000, 0x2BC0307F, 3 | BRF_GRA},   // 8
    {"svc-c7.bin",  0x800000, 0x4358D7B9, 3 | BRF_GRA},   // 9
    {"svc-c8.bin",  0x800000, 0x366DEEE5, 3 | BRF_GRA},   // 10

    {"svc-m1.bin",  0x020000, 0x804328C3, 4 | BRF_ESS | BRF_PRG},   // 11 Z80 code

    {"svc-v2.bin",  0x400000, 0xB5097287, 5 | BRF_SND},   // 12
    {"svc-v1.bin",  0x400000, 0xBD3A391F, 5 | BRF_SND},   // 13 Sound data
    {"svc-v4.bin",  0x400000, 0x33FC0B37, 5 | BRF_SND},   // 14
    {"svc-v3.bin",  0x400000, 0xAA9849A0, 5 | BRF_SND},   // 15
};

STDROMPICKEXT(svcsplus, svcsplus, neogeo);
STD_ROM_FN(svcsplus);

static void svcsplus_decrypt()
{
   int sec[] = {0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x07};
   int sed[] = {0x000000,0x700000,0x100000,0x200000,0x300000,0x400000,0x500000};

   unsigned char *src = Neo68KROM;
   int i,ofst,size = 0x800000;
   unsigned char *dst = (unsigned char*)malloc(size);

   memcpy( dst, src, size );

   for( i = 0; i < size / 2; i++ )   {
      ofst = BITSWAP16( (i & 0x007fff), 0x0f, 0x00, 0x08, 0x09, 0x0b, 0x0a, 0x0c, 0x0d,
                    0x04, 0x03, 0x01, 0x07, 0x06, 0x02, 0x05, 0x0e );

           ofst += (i & 0x078000);
           ofst += sec[ (i & 0xf80000) >> 19 ] << 19;

           memcpy( &src[ i * 2 ], &dst[ ofst * 2 ], 0x02 );
   }

   memcpy(dst,src,0x800000);

   for(i = 0; i < 7; ++i)
      memcpy(src+i*0x100000,dst+sed,0x100000);

   free(dst);

   svcboot_mx_decrypt();
   
   svcboot_c();

   *((unsigned short*)(Neo68KROM + 0x9E90)) = 0x000F; // Enable S. Plus
   *((unsigned short*)(Neo68KROM + 0x9E92)) = 0xC9C0;
   *((unsigned short*)(Neo68KROM + 0xA10C)) = 0x4EB9; // Enable boss icons
   *((unsigned short*)(Neo68KROM + 0xA10E)) = 0x000E;
   *((unsigned short*)(Neo68KROM + 0xA110)) = 0x9750;
}

static int svcsplusInit()
{
   pNeoInitCallback=svcsplus_decrypt;
   
   nNeoTextROMFixType = 5;
   
  memset(CartRAM,0,sizeof(CartRAM));
 
  int nRet=NeoInit();
  if(!nRet)
      mv0_BankMapHandler();
   return nRet;
}

struct BurnDriver BurnDrvsvcsplus= {
   "svcsplus","svcboot", "neogeo", "2003",
   "SvC Chaos: SNK vs Capcom Super Plus! (hack)\0格斗之王对街头霸王:混沌版超级加强 (盗版)\0图像、声音盗版加密\0",NULL,"SNK Playmore公司", "Neo Geo",
   NULL, NULL, NULL, NULL,
  BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_CUSTOM_BANKING | HARDWARE_SNK_SRAM,
  NULL, svcsplusRomInfo, svcsplusRomName, neogeoInputInfo, neogeoDIPInfo,
  svcsplusInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
  nNeoScreenWidth, 224, 4, 3
};


// SvC Chaos: SNK vs Capcom Plus! (hack, set 1) 格斗之王对街头霸王:混沌版加强 (盗版第一集)

static struct BurnRomInfo svcplusRomDesc[] = {
    {"svc-p1p.bin", 0x200000, 0xA194D842, 1 | BRF_ESS | BRF_PRG},   // 0 68K code
    {"svc-p2p.bin", 0x200000, 0x50C0E2B7, 1 | BRF_ESS | BRF_PRG},   // 1
    {"svc-p3p.bin", 0x200000, 0x58CDC293, 1 | BRF_ESS | BRF_PRG},   // 2    

    {"svc-s1p.bin", 0x020000, 0x73344711, 2 | BRF_GRA},   // 3

    {"svc-c1.bin",  0x800000, 0xA7826B89, 3 | BRF_GRA},   // 4 Sprite data
    {"svc-c2.bin",  0x800000, 0xED3C2089, 3 | BRF_GRA},   // 5
    {"svc-c3.bin",  0x800000, 0x71ED8063, 3 | BRF_GRA},   // 6
    {"svc-c4.bin",  0x800000, 0x250BDE2D, 3 | BRF_GRA},   // 7
    {"svc-c5.bin",  0x800000, 0x9817C082, 3 | BRF_GRA},   // 8
    {"svc-c6.bin",  0x800000, 0x2BC0307F, 3 | BRF_GRA},   // 9
    {"svc-c7.bin",  0x800000, 0x4358D7B9, 3 | BRF_GRA},   // 10
    {"svc-c8.bin",  0x800000, 0x366DEEE5, 3 | BRF_GRA},   // 11

    {"svc-m1.bin",  0x020000, 0x804328C3, 4 | BRF_ESS | BRF_PRG},   // 12 Z80 code

    {"svc-v2.bin",  0x400000, 0xB5097287, 5 | BRF_SND},   // 13
    {"svc-v1.bin",  0x400000, 0xBD3A391F, 5 | BRF_SND},   // 14 Sound data
    {"svc-v4.bin",  0x400000, 0x33FC0B37, 5 | BRF_SND},   // 15
    {"svc-v3.bin",  0x400000, 0xAA9849A0, 5 | BRF_SND},   // 16
};

STDROMPICKEXT(svcplus, svcplus, neogeo);
STD_ROM_FN(svcplus);

static void svcplus_decrypt()
{
   int sec[] = {0x00, 0x03, 0x02, 0x05, 0x04, 0x01};

   unsigned char *src = Neo68KROM;
   int i,ofst,rom_size = 0x600000;
   unsigned char *dst = (unsigned char*)malloc(rom_size);

   memcpy( dst, src, rom_size );

   for( i = 0; i < rom_size / 2; i++ ){
      ofst = BITSWAP24( (i & 0xfffff), 0x17, 0x16, 0x15, 0x14, 0x13, 0x00, 0x01, 0x02,
                   0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
                   0x07, 0x06, 0x05, 0x04, 0x03, 0x10, 0x11, 0x12 );
      ofst ^= 0x0f0007;
      ofst += (i & 0xff00000);
      memcpy( &src[ i * 2 ], &dst[ ofst * 2 ], 0x02 );
   }

   memcpy( dst, src, rom_size );

   for( i = 0; i < 6; i++ ){
      memcpy( &src[ i << 20 ], &dst[ sec[ i ] << 20 ], (1 << 20) );
   }

   free( dst );

   svcboot_mx_decrypt();
   
   svcboot_c();

   *((unsigned short*)(Neo68KROM + 0xF8016)) = 0x33C1; // Patch protected address
}

static int svcplusInit()
{
   pNeoInitCallback=svcplus_decrypt;
   
             nNeoTextROMFixType= 1;
   
  return NeoInit();
}

struct BurnDriver BurnDrvsvcplus= {
   "svcplus","svcboot", "neogeo", "2003",
   "SvC Chaos: SNK vs Capcom Plus! (hack, set 1)\0格斗之王对街头霸王:混沌版加强 (盗版第一集)\0图像、声音盗版加密\0",NULL,"SNK Playmore公司", "Neo Geo",
   NULL, NULL, NULL, NULL,
  BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SRAM,
  NULL, svcplusRomInfo, svcplusRomName, neogeoInputInfo, neogeoDIPInfo,
  svcplusInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
  nNeoScreenWidth, 224, 4, 3
};


// SvC Chaos: SNK vs Capcom Plus! (hack, set 2) 格斗之王对街头霸王:混沌版加强 (盗版第二集)

static struct BurnRomInfo svcplusaRomDesc[] = {
    {"svc-p1pl.bin",0x200000, 0x16B44144, 1 | BRF_ESS | BRF_PRG},   // 0 68K code
    {"svc-p2pl.bin",0x400000, 0x7231ACE2, 1 | BRF_ESS | BRF_PRG},   // 1
 
    {"svc-s1pl.bin",0x020000, 0xCA3C735E, 2 | BRF_GRA},   // 2

    {"svc-c1.bin",  0x800000, 0xA7826B89, 3 | BRF_GRA},   // 3 Sprite data
    {"svc-c2.bin",  0x800000, 0xED3C2089, 3 | BRF_GRA},   // 4
    {"svc-c3.bin",  0x800000, 0x71ED8063, 3 | BRF_GRA},   // 5
    {"svc-c4.bin",  0x800000, 0x250BDE2D, 3 | BRF_GRA},   // 6
    {"svc-c5.bin",  0x800000, 0x9817C082, 3 | BRF_GRA},   // 7
    {"svc-c6.bin",  0x800000, 0x2BC0307F, 3 | BRF_GRA},   // 8
    {"svc-c7.bin",  0x800000, 0x4358D7B9, 3 | BRF_GRA},   // 9
    {"svc-c8.bin",  0x800000, 0x366DEEE5, 3 | BRF_GRA},   // 10

    {"svc-m1.bin",  0x020000, 0x804328C3, 4 | BRF_ESS | BRF_PRG},   // 11 Z80 code

    {"svc-v2.bin",  0x400000, 0xB5097287, 5 | BRF_SND},   // 12
    {"svc-v1.bin",  0x400000, 0xBD3A391F, 5 | BRF_SND},   // 13 Sound data
    {"svc-v4.bin",  0x400000, 0x33FC0B37, 5 | BRF_SND},   // 14
    {"svc-v3.bin",  0x400000, 0xAA9849A0, 5 | BRF_SND},   // 15
};

STDROMPICKEXT(svcplusa, svcplusa, neogeo);
STD_ROM_FN(svcplusa);

static void svcplusa_decrypt()
{
   unsigned char* src = Neo68KROM;
   unsigned char* dst = (unsigned char*)malloc(0x600000);

   int sec[] = {0x100000,0x200000,0x300000,0x400000,0x500000,0x000000};
   if (dst){
      memcpy(dst,src,0x600000);
      for(int i = 0; i < 6; ++i){
         memcpy(src+i*0x100000,dst+sec,0x100000);
      }
      free(dst);
   }

  svcboot_mx_decrypt();
 
  svcboot_c();

   // Patch out protection bits
    *((unsigned short*)(Neo68KROM+0xF8016)) = 0x33C1;
}

static int svcplusaInit()
{
   pNeoInitCallback=svcplusa_decrypt;
   
             nNeoTextROMFixType= 3;
   
  return NeoInit();
}

struct BurnDriver BurnDrvsvcplusa= {
   "svcplusa","svcboot", "neogeo", "2003",
   "SvC Chaos: SNK vs Capcom Plus! (hack, set 2)\0格斗之王对街头霸王:混沌版加强 (盗版第二集)\0图像、声音盗版加密\0",NULL,"SNK Playmore公司", "Neo Geo",
   NULL, NULL, NULL, NULL,
  BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_SRAM,
  NULL, svcplusaRomInfo, svcplusaRomName, neogeoInputInfo, neogeoDIPInfo,
  svcplusaInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
  nNeoScreenWidth, 224, 4, 3
};

neo_run.cpp中
  //svcboot及其克隆ROM和斗婚(盗版)声音位交换 开始部分
  switch (nADPCMByteswap) {
      //斗婚(盗版)使用
      case 1 :
         //V2、V4ROM位交换
         BurnByteswap(YM2610ADPCMAROM+0x400000, 0x400000);
         BurnByteswap(YM2610ADPCMAROM+0xc00000, 0x400000);
         break;
      //svcboot、svcsplus、svcplus、svcplusa
       case 2 :
        BurnByteswap(YM2610ADPCMAROM,nYM2610ADPCMASize);
         break;
        //samsh5bl
        case 3 : {
         for(int i=0; i          YM2610ADPCMAROM = BITSWAP08(YM2610ADPCMAROM,0,1,5,4,3,2,6,7);   
         }
   }
   //svcboot和斗婚(盗版)声音位交换 结束部分

Offline Sho

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
  • Junior Member
Fix for Chinese directories
« Reply #4 on: February 05, 2005, 09:12:13 AM »
pigcat, netbug

thanks you very much, i want this for a long time,

Offline netbug

  • Newbies
  • *
  • Posts: 37
  • Karma: +1/-0
  • Member
Fix for Chinese directories
« Reply #5 on: February 07, 2005, 07:27:16 AM »
There is a generating RomCenter dat's error  resulting from the use function
setlocale(LC_ALL, ("Chinese_China")) in main.cpp.
My ameliorative solving method as follows(it may also adapt to other OS,
such as Taiwan,Hongkong,japan,brazil,spain and so forth):

dat.cpp
add
#include  // for use setlocale

find
if ((fDat = _tfopen(szFilename, _T("w")))==0)
      return -1;
add after:
setlocale( LC_ALL, "English" );

find
nRet =  write_datfile(nDatType, fDat);
fclose(fDat);

add atfer:(finally fixed)
//char szNativeLanguageName[40];
//GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,LOCALE_SENGLANGUAGE,szNativeLanguageName,sizeof(szNativeLanguageName));
//setlocale(LC_ALL,szNativeLanguageName);
setlocale(LC_ALL,"");


p.s:You may fix corresponding code in main.cpp. :D