SQL SERVER UNICODE STRING FUNCTION
UNICODE String function returns UNICODE value of first character in the STRING.
select nchar(UNICODE(N'हिन्दी'))
O/P:ह
select UNICODE(N'हिन्दी'))
O/P: 2361
Ex: Get each Unicode Characters of nvarchar String हिन्दी
declare @position int, @txt nvarchar(max);
set @position=1;
set @txt = N'हिन्दी';
while @position <= len(@txt)
begin
declare @t int;
select @t=unicode(substring(@txt,@position,1))
print '&#'+ CONVERT(nvarchar(5),@t)+';'
set @position = @position+1
end
set @position=1;
set @txt = N'हिन्दी';
while @position <= len(@txt)
begin
declare @t int;
select @t=unicode(substring(@txt,@position,1))
print '&#'+ CONVERT(nvarchar(5),@t)+';'
set @position = @position+1
end
O/P:
ह
ि
न
्
द
ी
ि
न
्
द
ी
Note:Copy this unicode characters and put in HTML Page user can get word Hindi in Hind Lanugage .i.e
हिन्दी
हिन्दी
Ex:Get Unicode characters of German String
"Die komplette Familie ist auf dem Cover der britischen Zeitschrift "Hello!"
declare @position int, @txt nvarchar(max);
set @position=1;
set @txt = N'Die komplette Familie ist auf dem Cover der britischen Zeitschrift "Hello!';
while @position <= Datalength(@txt)
begin
declare @t int;
select @t=unicode(substring(@txt,@position,1))
print '&#'+ CONVERT(nvarchar(5),@t)+';'
set @position = @position+1
end
set @position=1;
set @txt = N'Die komplette Familie ist auf dem Cover der britischen Zeitschrift "Hello!';
while @position <= Datalength(@txt)
begin
declare @t int;
select @t=unicode(substring(@txt,@position,1))
print '&#'+ CONVERT(nvarchar(5),@t)+';'
set @position = @position+1
end
D
i
e
 
k
o
m
p
l
e
t
t
e
 
F
a
m
i
l
i
e
 
i
s
t
 
a
u
f
 
d
e
m
 
C
o
v
e
r
 
d
e
r
 
b
r
i
t
i
s
c
h
e
n
 
Z
e
i
t
s
c
h
r
i
f
t
 
"
H
e
l
l
o
!
i
e
 
k
o
m
p
l
e
t
t
e
 
F
a
m
i
l
i
e
 
i
s
t
 
a
u
f
 
d
e
m
 
C
o
v
e
r
 
d
e
r
 
b
r
i
t
i
s
c
h
e
n
 
Z
e
i
t
s
c
h
r
i
f
t
 
"
H
e
l
l
o
!
Note:Copy this unicode characters and put in HTML Page user can get word
"
D
i
e
k
o
m
p
l
e
t
t
e
F
a
m
i
l
i
e
i
s
t
a
u
f
d
e
m
C
o
v
e
r
d
e
r
b
r
i
t
i
s
c
h
e
n
Z
e
i
t
s
c
h
r
i
f
t
"
H
e
l
l
o
!"
Tags: SQL SERVER UNICODE STRING FUNCTION,SQL SERVER NCHAR STRING FUNCTION,How to get all unicodes and characters from a String,get all unicodes and unicode characters from a String.
No comments:
Post a Comment