# Writing Unicode to MS Sql on Linux

**URL:** <https://www.ruby-forum.com/t/writing-unicode-to-ms-sql-on-linux/117382>\
**Category:** Rails\
**Created:** [October 16, 2007, 2:26pm UTC](https://www.ruby-forum.com/t/writing-unicode-to-ms-sql-on-linux/117382 "2007-10-16T14:26:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JTJTJT](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ec9cab/32.png) [@JTJTJT](https://www.ruby-forum.com/u/JTJTJT)\
**Post date:** [October 16, 2007, 2:26pm UTC](https://www.ruby-forum.com/t/writing-unicode-to-ms-sql-on-linux/117382/1 "2007-10-16T14:26:55Z")

</div>

Following the instructions on getting Rails to work with MS Sql on  
Linux worked as far as reading unicode data from the database.  
However, when I tried to write UTF-8 data that is non english the data  
became a series of ??.

Is there any solution or configuration required to write unicode data  
to MS Sql so that it will not try to apply a code page to the data and  
corrupt it in the process?

If I can modify the sql query constructed by Active Record to insert a  
N prefix to data value in the sql string, the problem may be solved  
but how do I hack into Active Record to do that?

For example

insert into mytable values ( N’unicodedata’ )

Thanks,

Joshua
