-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Option to prevent double encoding #78
Comments
Hello @diegomansua, Sorry for a long delay in the response. Can it be that this PR #86 solves your problem? |
@mdevils unless I'm doing something wrong it doesn't seem like it would solve my problem; I've checked out the PR branch and built it and tried the following:
I've tried also with Basically what I'd need is an option so that if an entity is already encoded (e.g. |
Hello @diegomansua. I'm afraid you have a very specific use-case. I'd suggest you to use a combination of
Hope this helps. |
Hello,
First of all thanks to everyone that has made this lib possible.
This is not a bug report but rather than a feature suggestion.
I'm using this lib to import data from a third party into an old database that only supports ISO-8859-1.
I was using it like
encode(<text>, {mode: 'nonAscii'})
.But I hit an issue as it turns out that the third party already uses entities for some characters. This means that I ended up with
&#39;
whenever there was a'
entity, for example.So I thought it'd be nice to have a
preventDoubleEncoding
option (only with a better name), to prevent encoding the ampersand whenever it's already part of an entity. E.g.:encode('you & me', {mode: 'nonAscii', preventDoubleEncoding: true});
-> returnsyou & me
encode('you & me', {mode: 'nonAscii', preventDoubleEncoding: false});
-> returnsyou & me
encode('you & me', {mode: 'nonAscii', preventDoubleEncoding: true});
-> returnsyou & me
encode('you & me', {mode: 'nonAscii', preventDoubleEncoding: false});
-> returnsyou &amp; me
The text was updated successfully, but these errors were encountered: