strgen/strgen.c
changeset 5548 209971b79b9a
parent 5111 05bb05c1e9b5
child 5623 ef2a8a524a95
equal deleted inserted replaced
5547:c12bc8d207b3 5548:209971b79b9a
   215 		PutByte(0xF0 + GB(value, 18, 3));
   215 		PutByte(0xF0 + GB(value, 18, 3));
   216 		PutByte(0x80 + GB(value, 12, 6));
   216 		PutByte(0x80 + GB(value, 12, 6));
   217 		PutByte(0x80 + GB(value,  6, 6));
   217 		PutByte(0x80 + GB(value,  6, 6));
   218 		PutByte(0x80 + GB(value,  0, 6));
   218 		PutByte(0x80 + GB(value,  0, 6));
   219 	} else {
   219 	} else {
   220 		warning("Invalid unicode value U+0x%X\n", value);
   220 		warning("Invalid unicode value U+0x%X", value);
   221 	}
   221 	}
   222 }
   222 }
   223 
   223 
   224 
   224 
   225 size_t Utf8Validate(const char *s)
   225 size_t Utf8Validate(const char *s)
  1384 		/* rename the .txt (input-extension) to .lng */
  1384 		/* rename the .txt (input-extension) to .lng */
  1385 		r = strrchr(pathbuf, '.');
  1385 		r = strrchr(pathbuf, '.');
  1386 		if (r == NULL || strcmp(r, ".txt") != 0) r = strchr(pathbuf, '\0');
  1386 		if (r == NULL || strcmp(r, ".txt") != 0) r = strchr(pathbuf, '\0');
  1387 		ttd_strlcpy(r, ".lng", (size_t)(r - pathbuf));
  1387 		ttd_strlcpy(r, ".lng", (size_t)(r - pathbuf));
  1388 		WriteLangfile(pathbuf, show_todo);
  1388 		WriteLangfile(pathbuf, show_todo);
       
  1389 
       
  1390 		/* if showing warnings, print a summary of the language */
       
  1391 		if (show_todo == 2) {
       
  1392 			fprintf(stdout, "%d warnings and %d errors for %s", _warnings, _errors, pathbuf);
       
  1393 		}
  1389 	} else {
  1394 	} else {
  1390 		fprintf(stderr, "Invalid arguments\n");
  1395 		fprintf(stderr, "Invalid arguments\n");
  1391 	}
  1396 	}
  1392 
  1397 
  1393 	return 0;
  1398 	return 0;