質問編集履歴
4
ソースを修正しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -76,8 +76,6 @@
|
|
76
76
|
|
77
77
|
#include <string.h>
|
78
78
|
|
79
|
-
#define MAX 10000
|
80
|
-
|
81
79
|
#define MAX2 170
|
82
80
|
|
83
81
|
|
@@ -92,91 +90,11 @@
|
|
92
90
|
|
93
91
|
char str2[150]="\" https://notify-api.line.me/api/notify";
|
94
92
|
|
95
|
-
char str3[MAX2];
|
96
|
-
|
97
|
-
char *tok;
|
98
|
-
|
99
|
-
char split[]=" ";
|
100
|
-
|
101
|
-
char kstr1[7][100]={""};
|
102
|
-
|
103
|
-
int i=0;
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
fgets(str3,MAX2,file);
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
tok = strtok( str3, split );
|
112
|
-
|
113
|
-
while( tok != NULL ){
|
114
|
-
|
115
|
-
strcpy(kstr1[i],tok);
|
116
|
-
|
117
|
-
tok = strtok( NULL, split );
|
118
|
-
|
119
|
-
i++;
|
120
|
-
|
121
|
-
}
|
122
93
|
|
123
94
|
|
124
95
|
|
125
96
|
|
126
|
-
|
127
|
-
s
|
97
|
+
fgets(buf2,MAX2,file);
|
128
|
-
|
129
|
-
strcat(buf2,"|");
|
130
|
-
|
131
|
-
strcat(buf2,kstr1[1]);
|
132
|
-
|
133
|
-
strcat(buf2,"|");
|
134
|
-
|
135
|
-
strcat(buf2,kstr1[2]);
|
136
|
-
|
137
|
-
strcat(buf2,"|");
|
138
|
-
|
139
|
-
strcat(buf2,kstr1[3]);
|
140
|
-
|
141
|
-
strcat(buf2,"|");
|
142
|
-
|
143
|
-
strcat(buf2,kstr1[4]);
|
144
|
-
|
145
|
-
strcat(buf2,"|");
|
146
|
-
|
147
|
-
strcat(buf2,kstr1[5]);
|
148
|
-
|
149
|
-
strcat(buf2,"|");
|
150
|
-
|
151
|
-
strcat(buf2,kstr1[6]);
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
printf("%x\n",kstr1[0][0] );
|
156
|
-
|
157
|
-
printf("%x\n",kstr1[0][1] );
|
158
|
-
|
159
|
-
printf("%x\n",kstr1[0][2] );
|
160
|
-
|
161
|
-
printf("%x\n",kstr1[0][3] );
|
162
|
-
|
163
|
-
printf("%x\n",kstr1[1][0] );
|
164
|
-
|
165
|
-
printf("%x\n",kstr1[1][1] );
|
166
|
-
|
167
|
-
printf("%x\n",kstr1[1][2] );
|
168
|
-
|
169
|
-
printf("%x\n",kstr1[1][3] );
|
170
|
-
|
171
|
-
printf("%x\n",kstr1[1][4] );
|
172
|
-
|
173
|
-
printf("%x\n",kstr1[1][5] );
|
174
|
-
|
175
|
-
printf("%x\n",kstr1[1][6] );
|
176
|
-
|
177
|
-
printf("%x\n",kstr1[1][7] );
|
178
|
-
|
179
|
-
printf("%x\n",kstr1[1][8] );
|
180
98
|
|
181
99
|
|
182
100
|
|
3
文字化け例修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
しかし、テキストファイルをパソコンにてメモ帳などのエディタを使って開くと文字化けはしていないのですが、ラインで受信したメッセージは文字化けしています。
|
4
4
|
|
5
|
-
ただ文字化けと言っても一部だけで、例えば「質問回答サイト」が「質問回
|
5
|
+
ただ文字化けと言っても一部だけで、例えば「質問回答サイト」が「質問回答サイチE」みたいな感じです。
|
6
6
|
|
7
7
|
試しに文字列変数の配列の中身を調べましたが、
|
8
8
|
|
2
ソースの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -63,3 +63,143 @@
|
|
63
63
|
環境はwindowsです。
|
64
64
|
|
65
65
|
プログラム自体はexeファイルです。
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
ソースは以下のとおりです。
|
70
|
+
|
71
|
+
```C
|
72
|
+
|
73
|
+
#include <stdio.h>
|
74
|
+
|
75
|
+
#include <stdlib.h>
|
76
|
+
|
77
|
+
#include <string.h>
|
78
|
+
|
79
|
+
#define MAX 10000
|
80
|
+
|
81
|
+
#define MAX2 170
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
int main(void){
|
86
|
+
|
87
|
+
FILE *file = fopen("test.txt","r");
|
88
|
+
|
89
|
+
char buf2[MAX2]={0};
|
90
|
+
|
91
|
+
char str1[400]="curl -k -X POST -H \"Authorization: Bearer *********************\" -F \"message=";
|
92
|
+
|
93
|
+
char str2[150]="\" https://notify-api.line.me/api/notify";
|
94
|
+
|
95
|
+
char str3[MAX2];
|
96
|
+
|
97
|
+
char *tok;
|
98
|
+
|
99
|
+
char split[]=" ";
|
100
|
+
|
101
|
+
char kstr1[7][100]={""};
|
102
|
+
|
103
|
+
int i=0;
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
fgets(str3,MAX2,file);
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
tok = strtok( str3, split );
|
112
|
+
|
113
|
+
while( tok != NULL ){
|
114
|
+
|
115
|
+
strcpy(kstr1[i],tok);
|
116
|
+
|
117
|
+
tok = strtok( NULL, split );
|
118
|
+
|
119
|
+
i++;
|
120
|
+
|
121
|
+
}
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
strcat(buf2,kstr1[0]);
|
128
|
+
|
129
|
+
strcat(buf2,"|");
|
130
|
+
|
131
|
+
strcat(buf2,kstr1[1]);
|
132
|
+
|
133
|
+
strcat(buf2,"|");
|
134
|
+
|
135
|
+
strcat(buf2,kstr1[2]);
|
136
|
+
|
137
|
+
strcat(buf2,"|");
|
138
|
+
|
139
|
+
strcat(buf2,kstr1[3]);
|
140
|
+
|
141
|
+
strcat(buf2,"|");
|
142
|
+
|
143
|
+
strcat(buf2,kstr1[4]);
|
144
|
+
|
145
|
+
strcat(buf2,"|");
|
146
|
+
|
147
|
+
strcat(buf2,kstr1[5]);
|
148
|
+
|
149
|
+
strcat(buf2,"|");
|
150
|
+
|
151
|
+
strcat(buf2,kstr1[6]);
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
printf("%x\n",kstr1[0][0] );
|
156
|
+
|
157
|
+
printf("%x\n",kstr1[0][1] );
|
158
|
+
|
159
|
+
printf("%x\n",kstr1[0][2] );
|
160
|
+
|
161
|
+
printf("%x\n",kstr1[0][3] );
|
162
|
+
|
163
|
+
printf("%x\n",kstr1[1][0] );
|
164
|
+
|
165
|
+
printf("%x\n",kstr1[1][1] );
|
166
|
+
|
167
|
+
printf("%x\n",kstr1[1][2] );
|
168
|
+
|
169
|
+
printf("%x\n",kstr1[1][3] );
|
170
|
+
|
171
|
+
printf("%x\n",kstr1[1][4] );
|
172
|
+
|
173
|
+
printf("%x\n",kstr1[1][5] );
|
174
|
+
|
175
|
+
printf("%x\n",kstr1[1][6] );
|
176
|
+
|
177
|
+
printf("%x\n",kstr1[1][7] );
|
178
|
+
|
179
|
+
printf("%x\n",kstr1[1][8] );
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
strcat(str1,buf2);
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
strcat(str1,str2);
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
system(str1);
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
fclose(file);
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
return EXIT_SUCCESS;
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
}
|
204
|
+
|
205
|
+
```
|
1
タイトルの誤字を修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
curlにて LINE Notifyに通知を送ると文字化けしてしま
|
1
|
+
curlにて LINE Notifyに通知を送ると文字化けしてしまいます。
|
test
CHANGED
File without changes
|