Skip to content
Advertisement

Translating python raw string / regex to ruby

I’m currently trying to translate a python script to ruby. Now I’m stuck on a part that uses a raw string for a regex.

This is the original python code:

JavaScript

This is my attempt to translate it to ruby:

JavaScript

Unfortunately I must be doing it wrong because I get this error:

JavaScript

I also tried:

JavaScript

But it results in the same error.

To place it in context, here is the whole script:

JavaScript

Advertisement

Answer

This answer shows why the problem raised.
https://stackoverflow.com/a/47785810/12349985

And there has a solution for this situation.
https://techoverflow.net/2013/12/29/solving-invalid-multibyte-escape-xfexff-in-ruby-vpim/

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement