Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btool 配下のソースコードを UTF-8 (BOM付き) に変換 #304

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions btool/RcCvt.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
////
////
// RcCvt : convert MSVC type resource file to Brc32 type.
// 20010820 aroka

Expand Down Expand Up @@ -37,10 +37,10 @@ bool RcCvt::setErr(char*errstr)
char *t;
int lcr = strlen(errstr)+2;
if( strerr ){
t = (char*)realloc( strerr , strlen(strerr)+lcr ); // 2003.10.31 moca �s�v��+1���폜
t = (char*)realloc( strerr , strlen(strerr)+lcr ); // 2003.10.31 moca 不要な+1を削除
}else{
// 2003.10.31 moca �s�v��+1���폜
// 2003.11.01 genta calloc��0�N���A��ۏ؂���
// 2003.10.31 moca 不要な+1を削除
// 2003.11.01 genta callocで0クリアを保証する
t = (char*)calloc( lcr, 1 );
}
if( t==NULL){
Expand Down Expand Up @@ -85,7 +85,7 @@ bool RcCvt::convert(void)
{
while( !feof(fpi) )
{
// 2007.04.03 genta �t�@�C�������œǂݍ��݃G���[�ɂȂ�ƍŏI�s���d�����ďo�͂����
// 2007.04.03 genta ファイル末尾で読み込みエラーになると最終行が重複して出力される
if( NULL == fgets(buffer, nLine, fpi )){
break;
}
Expand Down Expand Up @@ -135,8 +135,8 @@ bool RcCvt::include(char*linestr)
{
strcpy( linestr, "\n" );
}
//2002.01.10 ���납 ���\�[�X��Dlgs.h���폜
else if( strstr( linestr, "Dlgs.h" ) != NULL ) //2002.01.15 ���납 elsif -> else if
//2002.01.10 あろか リソースのDlgs.hを削除
else if( strstr( linestr, "Dlgs.h" ) != NULL ) //2002.01.15 あろか elsif -> else if
{
strcpy( linestr, "\n" );
}
Expand Down
14 changes: 7 additions & 7 deletions btool/RcCvt.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
////
////
// RcCvt : convert MSVC type resource file to Brc32 type.
// 20010820 aroka

Expand All @@ -14,13 +14,13 @@ class RcCvt {
private:
bool font(char*linestr);
bool include(char*linestr);
//! �G���[������̒lj�
//! エラー文字列の追加
bool setErr(char*errstr);

private:
FILE *fpi; //!<�ϊ���(����)�t�@�C���̃t�@�C���|�C���^
FILE *fpo; //!<�ϊ���(�o��)�t�@�C���̃t�@�C���|�C���^
int nLine; //!<1�s�̍ő咷�D�����o�b�t�@�̏��������Ƀo�b�t�@�T�C�Y�Ƃ��Ďg����D
char *strerr; //!< �G���[������ւ̃|�C���^
char *buffer; //!< �ǂݍ��݃o�b�t�@�ւ̃|�C���^�D
FILE *fpi; //!<変換元(入力)ファイルのファイルポインタ
FILE *fpo; //!<変換先(出力)ファイルのファイルポインタ
int nLine; //!<1行の最大長.内部バッファの初期化時にバッファサイズとして使われる.
char *strerr; //!< エラー文字列へのポインタ
char *buffer; //!< 読み込みバッファへのポインタ.
};
2 changes: 1 addition & 1 deletion btool/mrc2brc.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
////
////
// rmc2brc : convert MSVC type resource file to Brc32 type.
// 20010731 aroka

Expand Down
6 changes: 3 additions & 3 deletions btool/mrc2grc.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Expand Down Expand Up @@ -37,13 +37,13 @@ void convert(const char* infile, const char* outfile)
while( '\0' != *p ){
if( sjis_1(p) && sjis_2(p+1) ){
*o++ = *p++;
// SJIS��2�o�C�g�ڂ�\�������Ƃ�����\��t������
// SJISの2バイト目が\だったときだけ\を付加する
if( *p == '\\' ){
*o++ = '\\';
}
*o++ = *p++;
}else if( sjis_1(p) && *(p+1) == '\0' ){
// 1byte���񎝉z��
// 1byte次回持越し
buffer[0] = *p++;
buffer[1] = '\0';
carrierlen = 1;
Expand Down