-
Notifications
You must be signed in to change notification settings - Fork 69
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
Ruby 2.0.0: invalid multibyte escape: /^\xFF\xFE/ (SyntaxError) #5
Comments
Hey @pjg There are a few forks of vpim here and there which claim to add Ruby 2.0.0 compatibility. For example, a recent pull request by @gdjamerson went into this. Until @sam-github gets around to handling this in the core vpim gem, I'd recommend trying out some of the forked versions in the meantime. |
Yeah, thanks! I've already found the vcard gem, which does exactly what I need. |
any update on this? I'm currently experiencing this issue |
There are a bunch of forks of vpim that attempt to fix this problem in a myriad of ways, and I've written a summary of them. A lot of people, such as @pjg are doing fine with the vcard gem, which is a vpim fork that removes all the non-vCard functionality and simply removes the code causing the error. I've also rolled my own fork which replaces the erroring code with The downside is that folks generally cut out all the non-vCard functionality, such as the iCal stuff, in their forks. And some of them abandon support for older versions of Ruby. So watch out if either of those things is a relevant constraint in your case. You're probably going to need to shop around for a fork, though, because the guy who built this seems to have some other stuff going on at the moment and there's not really much movement on this issue. I have projects that I prioritise lower than others too so I know the feel. On that topic: hey @sam-github, if you can describe your ideal pull request for this issue - in terms of solution approach, minimum Ruby version support, etc - I will be happy to put in the time to make it happen. Sound good? |
I think it should work back to ruby1.8, which is still standard in many And I know the tests don't all pass anymore, but at least the ones that Shockingly, I've never received a pull request to fix this... I shopped around through the forks for an hour once, thinking surely Basically, its common to get strings loaded from file where you don't know starts with 1 byte 'B', its ascii or utf-8 Whats right in ruby1.9? As I understand 1.9, in theory the string coming in |
This fixes sam-github#5. Ruby 2.0 assumes UTF-8 sourcefile encoding.
FYI it think all new apps are ruby 2 and most older apps are ruby 1.9 by now, so dropping 1.8 support is not a big deal and 1.8 users can still use the old versions of the gem, so please merge those fixed + drop 1.8 & release :) |
Also, 1.8.7 was retired in June. |
OK, I'm cool with only 1.9/2.0 support. |
I think this is a good call. I spent a bit of time trying to make that BOM removal code play nice with 1.8, 1.9 and 2.0, and it wasn't very fun. |
So how about merging the 1.9/2.0 compatibility pulls ? On Wed, Sep 25, 2013 at 1:57 AM, Henry Smith [email protected]:
|
None of them work :-( In particular, they ignore the really nice comment block on the top explaining how to detect various encoding forms. I didn't add that because I was bored... address books I interact with write vcards as ucs-2, with no BOM (OS X, looking at you). just forcing the input encoding to utf-8 doesn't cut it, if it isn't utf-8. There must be a better way to do this in ruby 2, but I've never seen a PR that tried. h2s almost got this fixed, though, I'll try to finish it. |
IMHO Vpim should not be concerned with encodings in any way. On Thu, Sep 26, 2013 at 4:42 AM, Sam Roberts [email protected]:
|
I see there's been some movement on this in the commit log. I'm gonna spend some time testing it over the weekend, and hopefully start using vanilla vpim once again! Nice one Sam :) |
Fast forward to year 2015, and issue still persists, sad |
In
.bundle/gems/vpim-0.695/lib/vpim/vcard.rb:678
.And, well, "Application could not be started".
The text was updated successfully, but these errors were encountered: