[freetds] unicode

Jason Young (Morgon) morgon at mygamercard.net
Wed Jul 23 12:06:41 EDT 2008


The N syntax was for SQL Server only. I thought you were taking things 
out of Oracle and putting them into SQL Server (or at the very least, 
inserting them into both). I may have misinterpreted :-/


Murray, Laura (US) wrote:
> I added client charset = UTF-8 to the freetds.conf file.
> We are communicating from an Oracle db to a SQL Server db using freetds and an Oracle database link.
> I tried inserting with the N' as suggested:
>
> insert into JHK_PS_SNOTE at JJPTRNG.AM
> values ('FTR1',N'※ 恐れ入りますが振込手数料は御社にてご負担願います。','SENTHIL at GT','07/16/2008');
>
> So that sql statement was issued from an Oracle session and attempted to go over a db link.  The insert failed, complaining about syntax.  If I take the N away, the insert works fine, but the characters are garbled during transmission, of course.  Actually to be more specific, some of the Asian characters appear properly on the SQL Server side, but others appear as little boxes.
>
> Does this N'  syntax apply to Oracle?  It seems not to.....
>
> Thanks,
> Laurie
>
>
>
> -----Original Message-----
> From: freetds-bounces at lists.ibiblio.org [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of James K. Lowden
> Sent: Wednesday, July 23, 2008 9:48 AM
> To: FreeTDS Development Group
> Subject: Re: [freetds] unicode
>
> ZIGLIO, Frediano, VF-IT wrote:
>   
>> 1> insert into #tmp1 values(N'þ')
>> 2> go
>> 1> select * from #tmp1
>> 2> go
>> c
>> §
>> ?
>> þ
>> (3 rows affected)
>>     
>
> Wow.  I was able to reproduce that using U+0174.  (cf.
> http://www.unicode.org/charts/PDF/U0100.pdf.)  I can't seem to type that
> character in here; it's a W with a ^ on top.  Using Microsoft's tool, when
> I insert that into an NVARCHAR without the 'N' prefix, I get a plain "W"! 
>
>
>   
>> As you can see it seems that not using N prefix string got converted
>> twice, one ucs2->single and another single->ucs2 (nvarchar use ucs2).
>>     
>
> Right.  Without the 'N' prefix, the server took perfectly good UCS-2,
> converted it "down" to the database's single-byte encoding (Latin1-General
> in my case), and then stored that character as UCS-2 in the NVARCHAR
> column.  With the 'N', it did it right.  
>
> In the case of my W-with-hat, there's apparently a conversion rule that
> says to keep the main character and discard the "decoration" if possible. 
>
>
> Thanks for helping me understand this better.  It's a little hard for me
> to see it as a "feature"....
>
> Regards, 
>
> --jkl
>
> (Interestingly, on my BSD system, I see your character as 'þ' (phi?) but
> on my Win32 box it appears as one character that looks like 'io' squished
> together with the 'i' having a little bar across the middle. Font or
> encoding, I don't know.)  
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
>
> This email is for the use of the intended recipient(s) only.  If you have 
> received this email in error, please notify the sender immediately and then 
> delete it.  If you are not the intended recipient, you must not keep, use, 
> disclose, copy or distribute this email without the author's prior 
> permission.  We have taken precautions to minimize the risk of transmitting 
> software viruses, but we advise you to carry out your own virus checks on 
> any attachment to this message.  We cannot accept liability for any loss 
> or damage caused by software viruses.  The information contained in this 
> communication may be confidential and may be subject to the attorney-client 
> privilege. If you are the intended recipient and you do not wish to receive 
> similar electronic messages from us in the future then please respond to the 
> sender to this effect.
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>   



More information about the FreeTDS mailing list