-
Notifications
You must be signed in to change notification settings - Fork 313
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
Escaping "(" and ")" using ^040 and & ^41 in gs1 datamatrix encoder ends up with AI syntax error #307
Comments
Currently on holiday in remote southern Utah with intermittent access to internet. Will investigate this issue later next week. |
BTW, what version of bwip-js are you using? Older versions handled the |
Hey ! I'm using |
Definitely need to upgrade to the current version. |
Could you please advise how to upgrade it ? |
Typically, to upgrade a dependency, use |
Could you please answer , since I'm not Node.js guy, can't you just update it on bwipjs-api.metafloor.com ? |
It's your choice how you want to maintain your software. You should explore using npm as it simplifies and automates updates. But using git or the zip file link on github works as well. The bwip-js github repo is always up to date with the latest version. |
Ok, you're right. I was just raising the issue on specific place (bwipjs-api.metafloor.com). I thought, that since you are maintaining the web service - you can help, fixing it's sources. From I can tell I'm not the only one, who is using it, that's why may be you can consider fixing(updating) the source of bwipjs-api.metafloor.com. It will help me along with other users. Will be really appreciated ! |
Apologies. I mis-understood what you were asking. The version level of the public API has been updated. It is supposed to automatically update on each new release, but apparently there is a problem with the release script. |
Just before thanking you guys for such a great job you're doing - will justify a bit for those who may encounter same issue with parentheses while generating GS1 datamatrix on bwipjs-api.metafloor.com here's the example where you have a ")" within 21 AI (Serial Number) %29 is a ")" sign and the service is totally ok with it Thank you so much ! I'm sure that many people who are using your web service are happy 👍 Keep this service on ! Simple guys like me are relying on you ! |
So sorry to tell, but the issue occurred again.
I've tested and got
here's the status of bwipjs-api.metafloor.com: `OK 695812 requests, 3995.91 secs, 2376.18M bytes STARTED=2023-11-14 22:59:23 api-bwipjs.metafloor.com=34910 azteccode=264 I've tested on 3 resources : The error is the same. I see that AIs are parsed separately, since the error is now occurring in the 92 AI and the approach which is working for the AI 21 is not applied to any other. Could you please extend the parentheses parsing function to all AIs ? |
Looking at your example, I don't see where you are escaping extra parentheses with |
yes, indeed, as you may see I was not escaping them when you did an update. |
Tested with escaping sequence ^42 Used both url encoded string and url encoded string - error remains the same.
and
Please note that my previous example with parentheses in 21 AI works fine |
In the second example, the
And you are correct about the |
@metafloor Just to confirm, in case it wasn't clear, that this is not an issue with the BWIPP library, e.g. this works perfectly well:
For regular encoders, the For the GS1 application-specific helpers, there is an upfront parser that splits the bracketed element string into AI-value pairs and then validates the extracted data. Afterwards, the The ordinal syntax ( |
Thank you for the extra clarification Terry. The bug is understood but complex to fix while maintaining some semblance of performance. I am testing one fix right now but not happy with its brittleness. Have another idea to try out tomorrow... |
Happy New Year! Now mine example which throws Error: bwipp.GS1unknownAI#3205: AI e25P%C"(91: Unrecognised AI
The initial datamatrix code (without any encoding is the follows - again example from Perfumes) |
Currently testing a fix for this issue. The problem is in the emulation of the postscript dictionary stack. The BWIPP upstream code handles these test cases correctly. Unfortunately, the fix has caused a considerable change in the emitted PS-to-JS code so testing requires extra care. |
Version 4.2 should resolve this issue (finally!). Please give it a try and let me know. |
Closing this out as resolved. |
Hello ! @terryburton advised me to raise this issue, since it appears to be a bug.
Service throws error when you try to use parentheses as part of AI in any AI along with &parse and &parsefnc optional parameters.
(Example when "(" in 21 AI)
error - wrong syntax(Error: bwipp.GS1badCSET82character#2517: AI 21
Here's a full url with parameters(url encoded) :
http://bwipjs-api.metafloor.com/?bcid=gs1datamatrix&text=(01)03386460023344(21)5EK%5E040jlEhKVH%2CZ(91)EE08(92)xrmaCaDwfiJHiS2Z1Ad90tjmX5NwOQYMPqwAtpYE1s0%3D&parse&parsefnc
reproduced with and without url encoding
reproduced with and without optional parameters
STEPS TO REPRODUCE
Will be really appreciated if you can fix this.
The thing is: we are facing "(" and ")" in serial (21 AI) quite often. The example datamatrix I'd provided belongs to perfume.
The text was updated successfully, but these errors were encountered: