Loweynet
Revision | 66d898a778e94021d12df50eb2f6778748d31503 (tree) |
---|---|
Time | 2013-02-23 00:08:05 |
Author | s_kawamoto <s_kawamoto@user...> |
Commiter | s_kawamoto |
Fix tools for encoding literal messages into UTF-8.
@@ -1,2 +1,2 @@ | ||
1 | -utf8msg mesg-jpn.h mesg-jpn.h | |
2 | -utf8msg mesg-eng.h mesg-eng.h | |
1 | +utf8msg.exe mesg-jpn.h mesg-jpn.h | |
2 | +utf8msg.exe mesg-eng.h mesg-eng.h |
@@ -139,48 +139,48 @@ int _tmain(int argc, _TCHAR* argv[]) | ||
139 | 139 | _tsetlocale(LC_ALL, _T("")); |
140 | 140 | if(argc != 3) |
141 | 141 | { |
142 | - _tprintf(_T("UTF-8Å©ê½C¾ê\[Xt@Cà̶ñeðGR[hµÜ·B\n")); | |
143 | - _tprintf(_T("sÅÅÉo»·é¶ñeÍ»ÌÜÜÛ³êÜ·B\n")); | |
144 | - _tprintf(_T("sÅ2ÔÚÈ~Éo»·é¶ñeÍÅÌàÌÅGR[h³êÜ·B\n")); | |
145 | - _tprintf(_T("R}hC\n")); | |
146 | - _tprintf(_T("mbtoutf8 [in] [out]\n")); | |
147 | - _tprintf(_T("[in] ³Ì\[Xt@CÌt@C¼\n")); | |
148 | - _tprintf(_T("[out] Û¶æÌt@C¼\n")); | |
142 | + _tprintf(_T("Encode string literals in C language source files written in UTF-8.\n")); | |
143 | + _tprintf(_T("The first string literal in each line will be retained.\n")); | |
144 | + _tprintf(_T("The other string literals in each line will be encoded from the first one.\n")); | |
145 | + _tprintf(_T("Command line\n")); | |
146 | + _tprintf(_T("utf8msg.exe [in] [out]\n")); | |
147 | + _tprintf(_T("[in] Original source file name.\n")); | |
148 | + _tprintf(_T("[out] File name to save.\n")); | |
149 | 149 | return 0; |
150 | 150 | } |
151 | 151 | fpIn = _tfopen(argv[1], _T("rb")); |
152 | 152 | if(!fpIn) |
153 | 153 | { |
154 | - _tprintf(_T("t@C\"%s\"ªJ¯Ü¹ñB\n"), argv[1]); | |
154 | + _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[1]); | |
155 | 155 | return 0; |
156 | 156 | } |
157 | 157 | if(fseek(fpIn, 0, SEEK_END) != 0) |
158 | 158 | { |
159 | - _tprintf(_T("t@C\"%s\"ªJ¯Ü¹ñB\n"), argv[1]); | |
159 | + _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[1]); | |
160 | 160 | return 0; |
161 | 161 | } |
162 | 162 | InLength = ftell(fpIn); |
163 | 163 | if(fseek(fpIn, 0, SEEK_SET) != 0) |
164 | 164 | { |
165 | - _tprintf(_T("t@C\"%s\"ªJ¯Ü¹ñB\n"), argv[1]); | |
165 | + _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[1]); | |
166 | 166 | return 0; |
167 | 167 | } |
168 | 168 | pInBuffer = (char*)malloc(InLength); |
169 | 169 | if(!pInBuffer) |
170 | 170 | { |
171 | - _tprintf(_T("t@C\"%s\"ªJ¯Ü¹ñB\n"), argv[1]); | |
171 | + _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[1]); | |
172 | 172 | return 0; |
173 | 173 | } |
174 | 174 | if((long)fread(pInBuffer, 1, InLength, fpIn) != InLength) |
175 | 175 | { |
176 | - _tprintf(_T("t@C\"%s\"ªJ¯Ü¹ñB\n"), argv[1]); | |
176 | + _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[1]); | |
177 | 177 | return 0; |
178 | 178 | } |
179 | 179 | OutLength = InLength * 4; |
180 | 180 | pOutBuffer = (char*)malloc(OutLength); |
181 | 181 | if(!pOutBuffer) |
182 | 182 | { |
183 | - _tprintf(_T("t@C\"%s\"ªJ¯Ü¹ñB\n"), argv[1]); | |
183 | + _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[1]); | |
184 | 184 | return 0; |
185 | 185 | } |
186 | 186 | pIn = pInBuffer; |
@@ -233,44 +233,44 @@ int _tmain(int argc, _TCHAR* argv[]) | ||
233 | 233 | { |
234 | 234 | if(fseek(fpIn, 0, SEEK_END) != 0) |
235 | 235 | { |
236 | - _tprintf(_T("t@C\"%s\"ªJ¯Ü¹ñB\n"), argv[2]); | |
236 | + _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[2]); | |
237 | 237 | return 0; |
238 | 238 | } |
239 | 239 | InLength = ftell(fpIn); |
240 | 240 | if(fseek(fpIn, 0, SEEK_SET) != 0) |
241 | 241 | { |
242 | - _tprintf(_T("t@C\"%s\"ªJ¯Ü¹ñB\n"), argv[2]); | |
242 | + _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[2]); | |
243 | 243 | return 0; |
244 | 244 | } |
245 | 245 | pInBuffer = (char*)malloc(InLength); |
246 | 246 | if(!pInBuffer) |
247 | 247 | { |
248 | - _tprintf(_T("t@C\"%s\"ªJ¯Ü¹ñB\n"), argv[2]); | |
248 | + _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[2]); | |
249 | 249 | return 0; |
250 | 250 | } |
251 | 251 | if((long)fread(pInBuffer, 1, InLength, fpIn) != InLength) |
252 | 252 | { |
253 | - _tprintf(_T("t@C\"%s\"ªJ¯Ü¹ñB\n"), argv[2]); | |
253 | + _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[2]); | |
254 | 254 | return 0; |
255 | 255 | } |
256 | 256 | if(InLength == OutLength && memcmp(pInBuffer, pOutBuffer, InLength) == 0) |
257 | 257 | { |
258 | - _tprintf(_T("t@C\"%s\"ÍÏ·ÌKvª èܹñB\n"), argv[2]); | |
258 | + _tprintf(_T("There is no need to convert file \"%s\".\n"), argv[2]); | |
259 | 259 | return 0; |
260 | 260 | } |
261 | 261 | } |
262 | 262 | fpOut = _tfopen(argv[2], _T("wb")); |
263 | 263 | if(!fpOut) |
264 | 264 | { |
265 | - _tprintf(_T("t@C\"%s\"ªì¬Å«Ü¹ñB\n"), argv[2]); | |
265 | + _tprintf(_T("File \"%s\" cannot be created.\n"), argv[2]); | |
266 | 266 | return 0; |
267 | 267 | } |
268 | 268 | if((long)fwrite(pOutBuffer, 1, OutLength, fpOut) != OutLength) |
269 | 269 | { |
270 | - _tprintf(_T("t@C\"%s\"ªì¬Å«Ü¹ñB\n"), argv[2]); | |
270 | + _tprintf(_T("File \"%s\" cannot be created.\n"), argv[2]); | |
271 | 271 | return 0; |
272 | 272 | } |
273 | - _tprintf(_T("t@C\"%s\"ͳíÉÏ·³êܵ½B\n"), argv[2]); | |
273 | + _tprintf(_T("File \"%s\" was successfully converted.\n"), argv[2]); | |
274 | 274 | return 0; |
275 | 275 | } |
276 | 276 |
@@ -44,7 +44,7 @@ | ||
44 | 44 | PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" |
45 | 45 | MinimalRebuild="true" |
46 | 46 | BasicRuntimeChecks="3" |
47 | - RuntimeLibrary="3" | |
47 | + RuntimeLibrary="1" | |
48 | 48 | UsePrecompiledHeader="2" |
49 | 49 | WarningLevel="3" |
50 | 50 | DebugInformationFormat="4" |
@@ -115,7 +115,7 @@ | ||
115 | 115 | Optimization="2" |
116 | 116 | EnableIntrinsicFunctions="true" |
117 | 117 | PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" |
118 | - RuntimeLibrary="2" | |
118 | + RuntimeLibrary="0" | |
119 | 119 | EnableFunctionLevelLinking="true" |
120 | 120 | UsePrecompiledHeader="2" |
121 | 121 | WarningLevel="3" |
@@ -171,10 +171,6 @@ | ||
171 | 171 | UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" |
172 | 172 | > |
173 | 173 | <File |
174 | - RelativePath=".\utf8msg.cpp" | |
175 | - > | |
176 | - </File> | |
177 | - <File | |
178 | 174 | RelativePath=".\stdafx.cpp" |
179 | 175 | > |
180 | 176 | <FileConfiguration |
@@ -194,6 +190,10 @@ | ||
194 | 190 | /> |
195 | 191 | </FileConfiguration> |
196 | 192 | </File> |
193 | + <File | |
194 | + RelativePath=".\utf8msg.cpp" | |
195 | + > | |
196 | + </File> | |
197 | 197 | </Filter> |
198 | 198 | <Filter |
199 | 199 | Name="wb_[ t@C" |