Skip to Content.
Sympa Menu

freetds - Re: [freetds] unicode

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] unicode
  • Date: Wed, 23 Jul 2008 11:48:16 -0400

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.)





Archive powered by MHonArc 2.6.24.

Top of Page