o2on svn commit
o2on-****@lists*****
2008年 4月 23日 (水) 11:36:37 JST
Revision: 79 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=79 Author: electrolysis Date: 2008-04-23 11:36:37 +0900 (Wed, 23 Apr 2008) Log Message: ----------- FIX: EUC-JPãªdatã«æªå¯¾å¿ Modified Paths: -------------- branches/BRANCH_0043/o2on/src.o2on/O2DatIO.cpp branches/BRANCH_0043/o2on/src.o2on/O2DatIO.h Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatIO.cpp =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatIO.cpp 2008-04-22 03:38:02 UTC (rev 78) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatIO.cpp 2008-04-23 02:36:37 UTC (rev 79) @@ -154,12 +154,12 @@ if (p == NULL) return false; - return (KakoHantei(p, mf.size())); + return (KakoHantei(p, mf.size(), datpath.is_be())); } bool O2DatIO:: -KakoHantei(const char *dat, uint64 len) +KakoHantei(const char *dat, uint64 len, bool is_be) { int lf = 0; const char *p[2] = {NULL}; @@ -175,25 +175,40 @@ p[1]++; size_t linelen = p[0] - p[1]; + string encoding; + if (is_be) + sjis_or_euc(string(dat), encoding); + if (encoding.empty()) + encoding = "shift_jis"; + + string over1000 = "POOP<><>Over 1000 Thread"; + string stop = "<>â~µ½æB"; + string rula = "<>Ú]"; + if (encoding == "euc-jp"){ + sjis2euc(over1000); + sjis2euc(stop); + sjis2euc(rula); + } + // ----------------------------------------------------------------------- // 1000: eúªuOver 1000 Threadv // ex) POOP<><>Over 1000 Thread<>±ÌXbhÍPOOOð´¦Üµ½B <br> यȢÌÅAVµ¢Xbhð§Äľ³¢Å·BBB <> // ----------------------------------------------------------------------- - if (linelen >= 28 && strncmp(p[1], "POOP<><>Over 1000 Thread", 28) == 0) + if (linelen >= 28 && strncmp(p[1], over1000.c_str(), 28) == 0) return true; // ----------------------------------------------------------------------- // XXg: sªu<>â~µ½æBv // ex) â~µÜµ½BBB<>â~<>â~<>^EXbhXgbp[BBB(P[P)ÆÔد<>â~µ½æB // ----------------------------------------------------------------------- - if (linelen >= 14 && strncmp(p[0]-14, "<>â~µ½æB", 14) == 0) + if (linelen >= 14 && strncmp(p[0]-14, stop.c_str(), 14) == 0) return true; // ----------------------------------------------------------------------- // òε: sªu<>Ú]v // ex) Ïz°ÕÕÕ <>sage<>Ú]â~<> <br> Ïz°ÕÕÕ ³ñªòεܵ½B(P[P)ÆÔد <br> <br> BE |Cg = 4780 ©ç 20 ÁïµÜµ½B<br> <>Ú] // ----------------------------------------------------------------------- - if (linelen >= 6 && strncmp(p[0]-6, "<>Ú]", 6) == 0) + if (linelen >= 6 && strncmp(p[0]-6, rula.c_str(), 6) == 0) return true; return false; Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatIO.h =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatIO.h 2008-04-22 03:38:02 UTC (rev 78) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatIO.h 2008-04-23 02:36:37 UTC (rev 79) @@ -58,7 +58,7 @@ void SetEmergencyHaltCallbackMsg(HWND hwnd, UINT msg); bool KakoHantei(const O2DatPath &datpath); - bool KakoHantei(const char *dat, uint64 len); + bool KakoHantei(const char *dat, uint64 len, bool is_be); bool CheckDat(const char *in, uint64 inlen); bool GetTitle(O2DatPath &datpath); uint64 GetSize(const O2DatPath &datpath);