-
Notifications
You must be signed in to change notification settings - Fork 23
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
Encoding line breaks for things like Address and Notes #9
Comments
The same story - please create a PR for that. :-) |
@brendon Just an idea, assuming you'll be looking into this: There might be a more elegant fix in modifying the |
Hi @m1foley, Thanks for the suggestion, but I must say I'm completely lost :D I see the file but haven't the first idea where to start to fix this. I don't see anywhere in there that deals with the encoding of ascii line breaks. I'm definitely keen to put in a fix for this, but if you were willing to help me get my head around it that would be cool :) |
Taking a closer look, I think this is the method that needs modifying to cope with ascii newlines: def self.encode_text(v) #:nodoc:
v.to_str.gsub(/([\\,;\n])/) { $1 == "\n" ? "\\n" : "\\#{$1}" }
end Something like this? def self.encode_text(v) #:nodoc:
v.to_str.gsub(/\015\012/, "\n").gsub(/\015/, '\n').gsub(/([\\,;\n])/) { $1 == "\n" ? "\\n" : "\\#{$1}" }
end |
@brendon If you create a Pull Request with a failing test, I'll help and we'll come up with a fix together. |
Thanks @m1foley, got one for you there now. |
Is this fixed now? |
Yes all fixed :) |
I found that linebreaks weren't being encoded correctly. Gsubbing my strings with the following worked but would this be better placed inside the library?
The text was updated successfully, but these errors were encountered: