Browse CVS Repository
Diff of /malonnote/mnModel.cpp
Parent Directory
| Revision Log
| Revision Graph
| Patch
| 309 |
FILE* fp; |
FILE* fp; |
| 310 |
char buf[MAX_BUF_SIZE]; |
char buf[MAX_BUF_SIZE]; |
| 311 |
char fullPath[MAX_BUF_SIZE]; |
char fullPath[MAX_BUF_SIZE]; |
|
iconv_t codeSet; |
|
|
char outbuf[MAX_BUF_SIZE]; |
|
|
char* inbufPtr; |
|
|
char* outbufPtr; |
|
|
int inbufSize; |
|
|
int outbufSize; |
|
| 312 |
wxCSConv conv(wxT(CODE_SET_SYSTEM)); |
wxCSConv conv(wxT(CODE_SET_SYSTEM)); |
| 313 |
|
wxCSConv eucConv(wxT(CODE_SET_EUC_JP)); |
| 314 |
wxString* tmpStr; |
wxString* tmpStr; |
| 315 |
|
|
|
codeSet = iconv_open(CODE_SET_SYSTEM, CODE_SET_EUC_JP); |
|
|
if(codeSet == (iconv_t)-1) { |
|
|
MN_FATAL_ERROR(wxT("failed iconv_open")); |
|
|
} |
|
|
|
|
| 316 |
if(text) { |
if(text) { |
|
iconv_close(codeSet); |
|
| 317 |
return text; |
return text; |
| 318 |
} |
} |
| 319 |
|
|
| 325 |
} |
} |
| 326 |
|
|
| 327 |
while(fgets(buf, MAX_BUF_SIZE, fp)) { |
while(fgets(buf, MAX_BUF_SIZE, fp)) { |
| 328 |
inbufPtr = buf; |
tmpStr = new wxString(buf, eucConv); |
|
inbufSize = sizeof(buf); |
|
|
outbufPtr = outbuf; |
|
|
outbufSize = sizeof(outbuf); |
|
|
memset(outbuf, 0, outbufSize); |
|
|
iconv(codeSet, (ICONV_CONST char**)&inbufPtr, (size_t*)&inbufSize, &outbufPtr, (size_t*)&outbufSize); |
|
|
tmpStr = new wxString((char*)outbuf, conv); |
|
| 329 |
*text += *tmpStr; |
*text += *tmpStr; |
| 330 |
delete tmpStr; |
delete tmpStr; |
| 331 |
} |
} |
|
iconv_close(codeSet); |
|
| 332 |
fclose(fp); |
fclose(fp); |
|
|
|
| 333 |
return text; |
return text; |
| 334 |
} |
} |
| 335 |
|
|
|
|
Legend:
| Removed from v.1.9 |
|
| changed lines |
| |
Added in v.1.10 |
|
|
| |