mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-6015 add svn:mime-type charset tags.
X-SVN-Rev: 28384
This commit is contained in:
parent
592b73e980
commit
aaa55df26b
1 changed files with 5 additions and 2 deletions
|
@ -162,7 +162,7 @@ def check_utf8(file_name, base_mime_type, actual_mime_type):
|
|||
|
||||
if all(ord(byte) < 128 for byte in bytes):
|
||||
# pure ASCII.
|
||||
print "Pure ASCII " + file_name
|
||||
# print "Pure ASCII " + file_name
|
||||
return base_mime_type
|
||||
|
||||
try:
|
||||
|
@ -171,7 +171,10 @@ def check_utf8(file_name, base_mime_type, actual_mime_type):
|
|||
print "warning: %s: not ASCII, not UTF-8" % file_name
|
||||
return base_mime_type
|
||||
|
||||
# Append charset=utf-8. Need to escape the ';' because it is ultimately going to a shell.
|
||||
if ord(bytes[0]) != 0xef:
|
||||
print "UTF-8 file with no BOM: " + file_name
|
||||
|
||||
# Append charset=utf-8. Need to escape the ';' because it is ultimately going to a shell.
|
||||
return base_mime_type + '\\;charset=utf-8'
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue