schoero / swissqrbill

Swiss QR Bill generation in Node.js and browsers
MIT License
159 stars 29 forks source link

cdn.jsdelivr.net bundled version outdated(?) #371

Closed clementnuss closed 2 years ago

clementnuss commented 2 years ago

Hi,

first of all, thanks for the great library, really makes my life easier 👏🏻

I'm using the library within a web browser, and I import it as follows:

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/swissqrbill/lib/browser/bundle/index.js"></script>

const svg = new SwissQRBill.SVG(data, {language: "FR"});
document.getElementById('qr-bill').append(svg.element)

it works perfectly fine, except that I have some é and other accented characters in my strings, and that the generated QR code outputs strangely encoded chars.

I searched a bit in the issue, and found that you recently updated the QR code library: https://github.com/schoero/SwissQRBill/pull/367 to solve exactly this issue.

it seems that the bundled version I'm using, https://cdn.jsdelivr.net/npm/swissqrbill/lib/browser/bundle/index.js, is outdated, can that be?

If yes, could you update it? or advise another means of using an up-to-date version from within the browser?

Best regards, Clément

clementnuss commented 2 years ago

looking into this with more attention, it seems the issue could come from something else, as I've been able to generate a properly encoded QR with the link I referenced.

if you have an idea what could cause this (html accented chars to javascript ?) it might help, but I think I'll soon be able to close my issue anyways

clementnuss commented 2 years ago

confirming that there is no issue with your library, it works perfectly!

I had an issue where my underlying application was sending me text represented with html entities (i.e. stuff like &eacute;).

using the following Stackoverflow answer permitted me to solve this! https://stackoverflow.com/a/9609450/5556775