[quoted text, click to view] Sunil Virmani wrote:
> why it was working without N in =E5=AD=90=E3=81=A9 but not in =E4=BF=B1 ?
Try this (preferably with Results To Text, instead of Results To Grid):
SELECT a, CONVERT(varchar(10),a) b,
CONVERT(varchar(10),a COLLATE Japanese_Unicode_CI_AS) c
FROM (
SELECT N'abc' a
UNION ALL SELECT N'=C4=83=C3=AE=C5=9F=C5=A3=C3=A2'
UNION ALL SELECT N'=E5=AD=90=E3=81=A9'
UNION ALL SELECT N'=E4=BF=B1'
UNION ALL SELECT N'=CE=A3=D0=B4=D0=A4'
) u
This will return:
a b c
----- ---------- ----------
abc abc abc
=C4=83=C3=AE=C5=9F=C5=A3=C3=A2 a=C3=AEst=C3=A2 ?i??a
=E5=AD=90=E3=81=A9 ?? =E5=AD=90=E3=81=A9
=E4=BF=B1 ? ?
=CE=A3=D0=B4=D0=A4 S?? =CE=A3=D0=B4=D0=A4
You can see that some characters are replaced with the equivalent
non-accented characters, but some are replaced with question marks.
This depends on the code-page assigned to the expression, which depends
on the collation. It happens that the characters =E5=AD=90 and =E3=81=A9 ar=
e both
present in the 932 code page (Japanese), but the character =E4=BF=B1 is not
present (maybe it's too complex or more rarely used; I don't speak
japanese).
Usually, in each code-page there are at most 256 characters, because a
varchar stores each character on one byte. However, code page 932
(Japanese) is a DBCS code page (some characters are stored on two
bytes). You can see what characters are present in this code page here:
http://www.microsoft.com/globaldev/reference/dbcs/932.mspx For example, you can find the character =E5=AD=90 by clicking on 8E, at the
position 71.
Razvan