• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Loweynet


コミットメタ情報

リビジョン66d898a778e94021d12df50eb2f6778748d31503 (tree)
日時2013-02-23 00:08:05
作者s_kawamoto <s_kawamoto@user...>
コミッターs_kawamoto

ログメッセージ

Fix tools for encoding literal messages into UTF-8.

変更サマリ

差分

--- a/utf8msg.bat
+++ b/utf8msg.bat
@@ -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
Binary files a/utf8msg.exe and b/utf8msg.exe differ
--- a/utf8msg/utf8msg.cpp
+++ b/utf8msg/utf8msg.cpp
@@ -139,48 +139,48 @@ int _tmain(int argc, _TCHAR* argv[])
139139 _tsetlocale(LC_ALL, _T(""));
140140 if(argc != 3)
141141 {
142- _tprintf(_T("UTF-8‚ŏ‘‚©‚ꂽCŒ¾Œêƒ\[ƒXƒtƒ@ƒCƒ‹“à‚Ì•¶Žš—ñƒŠƒeƒ‰ƒ‹‚ðƒGƒ“ƒR[ƒh‚µ‚Ü‚·B\n"));
143- _tprintf(_T("s’†‚ōŏ‰‚ɏoŒ»‚·‚镶Žš—ñƒŠƒeƒ‰ƒ‹‚Í‚»‚Ì‚Ü‚Ü•ÛŽ‚³‚ê‚Ü‚·B\n"));
144- _tprintf(_T("s’†‚Å2”Ԗڈȍ~‚ɏoŒ»‚·‚镶Žš—ñƒŠƒeƒ‰ƒ‹‚͍ŏ‰‚Ì‚à‚̂ŃGƒ“ƒR[ƒh‚³‚ê‚Ü‚·B\n"));
145- _tprintf(_T("ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“\n"));
146- _tprintf(_T("mbtoutf8 [in] [out]\n"));
147- _tprintf(_T("[in] Œ³‚̃\[ƒXƒtƒ@ƒ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"));
149149 return 0;
150150 }
151151 fpIn = _tfopen(argv[1], _T("rb"));
152152 if(!fpIn)
153153 {
154- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚ªŠJ‚¯‚Ü‚¹‚ñB\n"), argv[1]);
154+ _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[1]);
155155 return 0;
156156 }
157157 if(fseek(fpIn, 0, SEEK_END) != 0)
158158 {
159- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚ªŠJ‚¯‚Ü‚¹‚ñB\n"), argv[1]);
159+ _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[1]);
160160 return 0;
161161 }
162162 InLength = ftell(fpIn);
163163 if(fseek(fpIn, 0, SEEK_SET) != 0)
164164 {
165- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚ªŠJ‚¯‚Ü‚¹‚ñB\n"), argv[1]);
165+ _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[1]);
166166 return 0;
167167 }
168168 pInBuffer = (char*)malloc(InLength);
169169 if(!pInBuffer)
170170 {
171- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚ªŠJ‚¯‚Ü‚¹‚ñB\n"), argv[1]);
171+ _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[1]);
172172 return 0;
173173 }
174174 if((long)fread(pInBuffer, 1, InLength, fpIn) != InLength)
175175 {
176- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚ªŠJ‚¯‚Ü‚¹‚ñB\n"), argv[1]);
176+ _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[1]);
177177 return 0;
178178 }
179179 OutLength = InLength * 4;
180180 pOutBuffer = (char*)malloc(OutLength);
181181 if(!pOutBuffer)
182182 {
183- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚ªŠJ‚¯‚Ü‚¹‚ñB\n"), argv[1]);
183+ _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[1]);
184184 return 0;
185185 }
186186 pIn = pInBuffer;
@@ -233,44 +233,44 @@ int _tmain(int argc, _TCHAR* argv[])
233233 {
234234 if(fseek(fpIn, 0, SEEK_END) != 0)
235235 {
236- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚ªŠJ‚¯‚Ü‚¹‚ñB\n"), argv[2]);
236+ _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[2]);
237237 return 0;
238238 }
239239 InLength = ftell(fpIn);
240240 if(fseek(fpIn, 0, SEEK_SET) != 0)
241241 {
242- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚ªŠJ‚¯‚Ü‚¹‚ñB\n"), argv[2]);
242+ _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[2]);
243243 return 0;
244244 }
245245 pInBuffer = (char*)malloc(InLength);
246246 if(!pInBuffer)
247247 {
248- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚ªŠJ‚¯‚Ü‚¹‚ñB\n"), argv[2]);
248+ _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[2]);
249249 return 0;
250250 }
251251 if((long)fread(pInBuffer, 1, InLength, fpIn) != InLength)
252252 {
253- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚ªŠJ‚¯‚Ü‚¹‚ñB\n"), argv[2]);
253+ _tprintf(_T("File \"%s\" cannot be opened.\n"), argv[2]);
254254 return 0;
255255 }
256256 if(InLength == OutLength && memcmp(pInBuffer, pOutBuffer, InLength) == 0)
257257 {
258- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚Í•ÏŠ·‚Ì•K—v‚ª‚ ‚è‚Ü‚¹‚ñB\n"), argv[2]);
258+ _tprintf(_T("There is no need to convert file \"%s\".\n"), argv[2]);
259259 return 0;
260260 }
261261 }
262262 fpOut = _tfopen(argv[2], _T("wb"));
263263 if(!fpOut)
264264 {
265- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚ªì¬‚Å‚«‚Ü‚¹‚ñB\n"), argv[2]);
265+ _tprintf(_T("File \"%s\" cannot be created.\n"), argv[2]);
266266 return 0;
267267 }
268268 if((long)fwrite(pOutBuffer, 1, OutLength, fpOut) != OutLength)
269269 {
270- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚ªì¬‚Å‚«‚Ü‚¹‚ñB\n"), argv[2]);
270+ _tprintf(_T("File \"%s\" cannot be created.\n"), argv[2]);
271271 return 0;
272272 }
273- _tprintf(_T("ƒtƒ@ƒCƒ‹\"%s\"‚͐³í‚É•ÏŠ·‚³‚ê‚Ü‚µ‚½B\n"), argv[2]);
273+ _tprintf(_T("File \"%s\" was successfully converted.\n"), argv[2]);
274274 return 0;
275275 }
276276
--- a/utf8msg/utf8msg.vcproj
+++ b/utf8msg/utf8msg.vcproj
@@ -44,7 +44,7 @@
4444 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
4545 MinimalRebuild="true"
4646 BasicRuntimeChecks="3"
47- RuntimeLibrary="3"
47+ RuntimeLibrary="1"
4848 UsePrecompiledHeader="2"
4949 WarningLevel="3"
5050 DebugInformationFormat="4"
@@ -115,7 +115,7 @@
115115 Optimization="2"
116116 EnableIntrinsicFunctions="true"
117117 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
118- RuntimeLibrary="2"
118+ RuntimeLibrary="0"
119119 EnableFunctionLevelLinking="true"
120120 UsePrecompiledHeader="2"
121121 WarningLevel="3"
@@ -171,10 +171,6 @@
171171 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
172172 >
173173 <File
174- RelativePath=".\utf8msg.cpp"
175- >
176- </File>
177- <File
178174 RelativePath=".\stdafx.cpp"
179175 >
180176 <FileConfiguration
@@ -194,6 +190,10 @@
194190 />
195191 </FileConfiguration>
196192 </File>
193+ <File
194+ RelativePath=".\utf8msg.cpp"
195+ >
196+ </File>
197197 </Filter>
198198 <Filter
199199 Name="ƒwƒbƒ_[ ƒtƒ@ƒCƒ‹"