Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fixes #84 "invalid byte sequence in UTF-8" #86

Open
wants to merge 1 commit into from

2 participants

@everplays

by running "bpm init" an "invalid byte sequence in UTF-8 (ArgumentError)"
error happened which this one fixes it

@everplays everplays fixes "invalid byte sequence in UTF-8"
by running "bpm init" an "invalid byte sequence in UTF-8 (ArgumentError)"
error happened that this commit fixes error
d88e331
@wagenet
Owner

This fix concerns me a bit. It seems like there's probably an issue that it's just ignoring. We should be figuring out why the encoding is invalid. Furthermore, iconv is deprecated in Ruby 1.9.

@everplays

I'm not a ruby developer & couldn't get String.encode working so i used Iconv (also didn't know that it's deprecated).

by the way i got value of plugin_ctx into a file & fixed it using iconv command:

iconv -t UTF8//IGNORE -f UTF8 < /tmp/plugin_ctx > /tmp/plugin_ctx-fixed

one of changes is copyright of sprade:
from: // Copyright: ©2010 Strobe Inc. All rights reserved.
to: // Copyright: ©2010 Strobe Inc. All rights reserved.

also seems line of spade.register has problem, but it's too long & i couldn't find the exact change. take a look at https://gist.github.com/1344293 (contains both "plugin_ctx" & "plugin_ctx-fixed")

@everplays

ok, the change in spade.register seems to be safe too:

from: IS PROVIDED BY THE COPYRIGHT HOLDER â\u0080\u009cAS ISâ\u0080\u009d AND
to:     IS PROVIDED BY THE COPYRIGHT HOLDER \u0080\u009cAS IS\u0080\u009d AND.

I'm not sure if it's the only change on that line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 6, 2011
  1. @everplays

    fixes "invalid byte sequence in UTF-8"

    everplays authored
    by running "bpm init" an "invalid byte sequence in UTF-8 (ArgumentError)"
    error happened that this commit fixes error
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/bpm/pipeline/generated_asset.rb
View
3  lib/bpm/pipeline/generated_asset.rb
@@ -87,6 +87,9 @@ def minify_body(data)
DATA = #{data.to_json};
end_eval
+ ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
+ plugin_ctx = ic.iconv(plugin_ctx)
+
ctx = BPM.compile_js(plugin_ctx);
data = ctx.eval("BPM_PLUGIN.minify(DATA, CTX)")
Something went wrong with that request. Please try again.