rails-sqlserver/activerecord-sqlserver-adapter — Issue #159: UniqueIdentifier/UT8 Conversion on Linux
Author: erichhorde
Created: 2012-01-18 19:02:12+00:00
State: open

I've using the adapter in Linux environment to connect to a database on windows, obviously. When inspecting a given attribute of a model whose db-type is uniqueidentifier, I get something like this:

```ruby
# In a Linux
@some_model.i_am_a_unique_identifier
-> ";\x15\xB9\xB3\xC6/\xADE\xBDV\xF0\xE0\e\xFCQp"
```

In windows, howeover, the value returned is a valid guid.

```ruby
# In Windows
@some_model.i_am_a_unique_identifier
-> 'B3B9153B-2FC6-45AD-BD56-F0E01BFC5170'
```

Similarly, the same thing happens with raw SQL.

```ruby
# In a Linux
SomeModel.connection.select_value "select unique_identifier_field from some_table;"
-> ";\x15\xB9\xB3\xC6/\xADE\xBDV\xF0\xE0\e\xFCQp"
```

I don't have any issues with other field types, at this point. Am I missing something, perhaps?

For reference, here's the database config.

```yaml
development:
adapter: sqlserver
host: 172.16.144.129
database: *****_development
username: *****
password: *****
mode: dblib
```

I have also tried setting an "encoding" value of "utf8", but to no avail.