Index: base/mac/mac_util.mm |
diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm |
index 647faf3866f0d52d982e532e8cd2568ef12efce5..ccb694878ba8693a0abaf853899f72f55531d8e4 100644 |
--- a/base/mac/mac_util.mm |
+++ b/base/mac/mac_util.mm |
@@ -402,6 +402,24 @@ bool RemoveQuarantineAttribute(const FilePath& file_path) { |
return status == 0 || errno == ENOATTR; |
} |
+bool CharacterIsPrintable(unichar c) { |
+ switch (c) { |
+ case 0xf728: // Delete |
+ return false; |
+ } |
+ return true; |
+} |
+ |
+bool StringIsPrintable(NSString* s) { |
+ if (s.length == 0) |
+ return true; |
+ for (NSUInteger i = 0; i < s.length; ++i) { |
+ if (CharacterIsPrintable([s characterAtIndex:i])) |
+ return true; |
+ } |
+ return false; |
+} |
+ |
namespace { |
// Returns the running system's Darwin major version. Don't call this, it's |