unlobito / skunk

Easy access to your store cards and other barcodes from your Pebble.
Other
29 stars 14 forks source link

use SDK v3.6+ and change to support non-english characters #17

Closed andrwj closed 8 years ago

andrwj commented 8 years ago

Some changes for compiling SDK v3.6 and displaying non-english characters. The '/script.js' should be modified to accept encodeURIComponent(), decodeURIComponent() functions around 76, 219 lines:

line#76

$(document).ready(function() {
  var data = jQuery.parseJSON(decodeURIComponent(window.location.hash.substring(1)));

  if (data !== "") {
    renderData(data);
  }
});

line#219

function generatePebbleURL() {
  data = collectData(true);

  if (!data) {
    return;
  }

  data_str = encodeURIComponent(JSON.stringify(data));

  location.href = 'pebblejs://close#' + data_str;
}
unlobito commented 8 years ago

Hi Andrew,

I really appreciate your help with attempting to make special characters work but I'm unfortunately unable to accept this pull request as base64 was intentionally used to resolve issue https://github.com/henriwatson/skunk/issues/13. Base64 is another encoding format that serves a similar purpose as URI encoding and also allows special characters to be safely delivered to the server and back.

Special character support is a two-fold issue: skunk doesn't (to the best of my knowledge) use a font that supports displaying the right glyphs and skunk-config chokes on the special characters. I've opened issue https://github.com/henriwatson/skunk/issues/18 to keep track of this.

Please feel free to create another pull request with just https://github.com/andrwj/skunk/commit/e73e81014383d1d4f525b0ebd3802fdfc4137abc or a different solution to https://github.com/henriwatson/skunk/issues/18

Thank you very much for your help. :)