-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non ASCII characters in filename --> file not found #190
Comments
Since there's no official solution, I'm using a function to remove all "special" characters from filename. function parseFilename(originalString) {
var parsed = originalString.substring(0, 100);
var specialChars = {
a: /[\xE0-\xE6]/g,
A: /[\xC0-\xC6]/g,
e: /[\xE8-\xEB]/g,
E: /[\xC8-\xCB]/g,
i: /[\xEC-\xEF]/g,
I: /[\xCC-\xCF]/g,
o: /[\xF2-\xF6]/g,
O: /[\xD2-\xD6]/g,
u: /[\xF9-\xFC]/g,
U: /[\xD9-\xDC]/g,
c: /\xE7/g,
C: /\xC7/g,
n: /\xF1/g,
N: /\xD1/g,
_: /[^A-Za-z0-9.]/g
};
for (var char in specialChars) {
var regEx = specialChars[char];
parsed = parsed.replace(regEx, char);
}
return parsed;
} |
@polfdz i believe this was fixed in |
the problem still exists ... file with Greek chars throws {status: 9, message: "File not found"} |
yes looks like this issue still exists as all non ASCII characters seem to throw this error. I'm going to close #252 as a duplicate and perhaps pin this issue for now as it seems to be one of the more significant bugs in this plugin. |
Can this be an encoding issue with how Java or Objective-C works? Because this plugin does not do anything special. The way cordova-plugin-file-opener2/src/android/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java Lines 93 to 103 in f7e1da9
If you look back in the git history, you'll see that this has been changed through merging pull requests. Does Java's |
I have the same problem with german characters ß, ä, ö and ü. |
The plugin fails when trying to open a file with an accent like tèst.pdf, however if I rename it to test.pdf it opens.
The error thrown is:
{status: 9, message: "File not found"}
Is there any solution?
Thanks in advance
The text was updated successfully, but these errors were encountered: