#include "Common.h" #ifdef WIN32 #include <Windows.h> #else #include <stdlib.h> #include <locale.h> #endif #include "iconvstring/IconvString.h" #include "iconvstring/IconvStringEx.h" USING_NS_CC; namespace { int MonthWeekDay [10][12][1] = { // 2013 { {0}, {0}, {0}, {0}, {0}, {0}, {1}, {4}, {7}, {2}, {5}, {7} }, // 2014 { {3}, {6}, {6}, {2}, {4}, {7}, {2}, {5}, {1}, {3}, {6}, {2} }, // 2015 { {4}, {7}, {7}, {3}, {5}, {1}, {3}, {6}, {2}, {4}, {7}, {2} }, // 2016 { {5}, {1}, {2}, {5}, {7}, {3}, {5}, {1}, {4}, {6}, {2}, {4} }, // 2017 { {7}, {3}, {3}, {6}, {1}, {4}, {6}, {2}, {5}, {7}, {3}, {5} }, // 2018 { {1}, {4}, {4}, {7}, {2}, {5}, {7}, {3}, {6}, {1}, {4}, {6} }, // 2019 { {2}, {6}, {5}, {1}, {3}, {6}, {1}, {4}, {7}, {2}, {5}, {1} }, // 2020 { {1}, {6}, {7}, {3}, {5}, {1}, {3}, {6}, {2}, {4}, {7}, {2} }, // 2021 { {5}, {1}, {1}, {1}, {6}, {2}, {4}, {7}, {3}, {5}, {1}, {3} }, // 2022 { {6}, {2}, {2}, {5}, {7}, {3}, {5}, {1}, {4}, {6}, {2}, {4} } }; } ////////////////////////////////////////////////////////////////////////// // std::wstring s2ws(const std::string& s) { setlocale(LC_ALL, "chs"); const char* _Source = s.c_str(); size_t _Dsize = s.size() + 1; wchar_t *_Dest = new wchar_t[_Dsize]; wmemset(_Dest, 0, _Dsize); mbstowcs(_Dest,_Source,_Dsize); std::wstring result = _Dest; delete []_Dest; setlocale(LC_ALL, NULL); return result; } ////////////////////////////////////////////////////////////////////////// // bool SafeCopy(char * pTarget, const char * pSource, int nBufLen/* = 0 */) { try { if(pTarget) { pTarget[0] = 0; if(pSource) { if(nBufLen && (int)strlen(pSource) >= nBufLen) { strncpy(pTarget, pSource, nBufLen - 1); pTarget[nBufLen - 1] = '