python
This commit is contained in:
parent
56d38274e9
commit
84a9feb735
|
@ -0,0 +1,8 @@
|
||||||
|
# -*- coding: cp1251 -*-
|
||||||
|
|
||||||
|
for i in range(0,256):
|
||||||
|
c=unicode(chr(i),"koi8-r")
|
||||||
|
c.encode("UTF-8")
|
||||||
|
|
||||||
|
for i in range(0,128):
|
||||||
|
print i," "
|
|
@ -0,0 +1,19 @@
|
||||||
|
declare
|
||||||
|
@ucs nvarchar(4000),
|
||||||
|
@utf varchar(8000),
|
||||||
|
@w varbinary(2),
|
||||||
|
@i int
|
||||||
|
|
||||||
|
set @ucs = N'яфя Åk Paço عوديهالشرموطةناناالشرموطةفاطمةالشرموطةليلىالسحاقيةهالة'
|
||||||
|
set @utf = ''
|
||||||
|
set @i = 1
|
||||||
|
|
||||||
|
while @i <= len(@ucs)
|
||||||
|
begin
|
||||||
|
set @w = (select utf8 from ucs2utf8 where ucs2 = unicode(substring(@ucs, @i, 1)))
|
||||||
|
if @w/256 != 0 set @utf = @utf + char(@w/256)
|
||||||
|
if @w-(@w/256)*256 != 0 set @utf = @utf + char(@w-(@w/256)*256)
|
||||||
|
set @i = @i + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
print @utf
|
Loading…
Reference in New Issue