spatialillusions / milsymbol

Military Symbols in JavaScript
www.spatialillusions.com/milsymbol
MIT License
544 stars 133 forks source link

Cyrillic Amplifier Fields #234

Closed yevhenii-username closed 4 years ago

yevhenii-username commented 4 years ago

When I tried use cyrillic for Amplifier Fields I reciece error Uncaught DOMException: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.

For solving this problem i rewrite toDataURL method


Symbol.prototype.toDataURL = function() {
  return (
    "data:image/svg+xml;base64," + window.btoa(unescape(encodeURIComponent(this.asSVG())))
  );
};