Skip to content

Commit c7380ff

Browse files
author
Dan Wood
committed
Add "-utf8" generation option to make it easier to store your source tree .strings files in UTF-8, which is much easier to manage. (Modern Xcode will copy your .strings files into UTF-16 into the binary anyhow, so no need to store them as UTF-16.)
1 parent 6ea48fb commit c7380ff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Demo/Source/main.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ int main (int argc, const char *argv[])
135135
{
136136
outputStringEncoding = NSUTF16BigEndianStringEncoding;
137137
}
138+
else if (!strcmp("-utf8", argv[i]))
139+
{
140+
outputStringEncoding = NSUTF8StringEncoding;
141+
}
138142
else if (!strcmp("-macRoman", argv[i]))
139143
{
140144
inputStringEncoding = NSMacOSRomanStringEncoding;
@@ -231,6 +235,7 @@ void showUsage(void)
231235
printf(" -q turns off multiple key/value pairs warning.\n");
232236
printf(" -bigEndian output generated with big endian byte order.\n");
233237
printf(" -littleEndian output generated with little endian byte order.\n");
238+
printf(" -utf8 output generated as UTF-8 not UTF-16.\n");
234239
printf(" -o dir place output files in 'dir'.\n\n");
235240
printf(" -defaultTable tablename use 'tablename' instead of 'Localizable' as default table name.\n");
236241
printf(" Please see the genstrings2(1) man page for full documentation\n");

0 commit comments

Comments
 (0)