diff --git a/src/file/FileUtils.js b/src/file/FileUtils.js index cf6648a0841..50e22e28614 100644 --- a/src/file/FileUtils.js +++ b/src/file/FileUtils.js @@ -160,6 +160,8 @@ define(function (require, exports, module) { result = Strings.NO_MODIFICATION_ALLOWED_ERR_FILE; } else if (name === FileSystemError.CONTENTS_MODIFIED) { result = Strings.CONTENTS_MODIFIED_ERR; + } else if (name === FileSystemError.UNSUPPORTED_ENCODING) { + result = Strings.UNSUPPORTED_ENCODING_ERR; } else { result = StringUtils.format(Strings.GENERIC_ERROR, name); } diff --git a/src/filesystem/FileSystemError.js b/src/filesystem/FileSystemError.js index a4d780c3765..7dab50caf8c 100644 --- a/src/filesystem/FileSystemError.js +++ b/src/filesystem/FileSystemError.js @@ -39,6 +39,7 @@ define(function (require, exports, module) { INVALID_PARAMS : "InvalidParams", NOT_FOUND : "NotFound", NOT_READABLE : "NotReadable", + UNSUPPORTED_ENCODING : "UnsupportedEncoding", NOT_SUPPORTED : "NotSupported", NOT_WRITABLE : "NotWritable", OUT_OF_SPACE : "OutOfSpace", diff --git a/src/filesystem/impls/appshell/AppshellFileSystem.js b/src/filesystem/impls/appshell/AppshellFileSystem.js index 46f8d673064..433eeacde6f 100644 --- a/src/filesystem/impls/appshell/AppshellFileSystem.js +++ b/src/filesystem/impls/appshell/AppshellFileSystem.js @@ -160,7 +160,7 @@ define(function (require, exports, module) { case appshell.fs.ERR_CANT_WRITE: return FileSystemError.NOT_WRITABLE; case appshell.fs.ERR_UNSUPPORTED_ENCODING: - return FileSystemError.NOT_READABLE; + return FileSystemError.UNSUPPORTED_ENCODING; case appshell.fs.ERR_OUT_OF_SPACE: return FileSystemError.OUT_OF_SPACE; case appshell.fs.ERR_FILE_EXISTS: diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 0e1774f2389..236741b4810 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -37,6 +37,7 @@ define({ "NO_MODIFICATION_ALLOWED_ERR" : "The target directory cannot be modified.", "NO_MODIFICATION_ALLOWED_ERR_FILE" : "The permissions do not allow you to make modifications.", "CONTENTS_MODIFIED_ERR" : "The file has been modified outside of {APP_NAME}.", + "UNSUPPORTED_ENCODING_ERR" : "The file is not UTF-8 encoded text.", "FILE_EXISTS_ERR" : "The file or directory already exists.", "FILE" : "file", "DIRECTORY" : "directory",