piersharding / ruby-sapnwrfc

SAP RFC Connector using the SAP NW RFC SDK for Ruby
http://www.piersharding.com/blog/
36 stars 17 forks source link

Fix utf8 encoding for ruby 191 and later #6

Closed jhf closed 9 years ago

jhf commented 9 years ago

Ruby 1.9.1 and later tracks the encoding of every string, so all strings must be declared with an encoding that matches their actual content. Without this patch the SAP strings are marked as ASCII-8BIT and are displaying incorrectly. This is fixed by marking the SAP returned strings as UTF-8 strings.

In passing I also fixed a missing include that causes the gem installation build of the C extension to fail. Tested in with ruby 1.9.3-p551.

piersharding commented 9 years ago

Hi -

Thanks for this.

Cheers, Piers Harding.