Hi,
How to convert and transfer ANSI string data from FoxPro table to MS SQL
Unicode table. Data in FoxPro are in 1251 codepage (Russian Windows). Now
result is like " 100 ".The ODBC driver does not
performs the conversion from ANSI to Unicode.
Help.
Does STRCONV() help?
-Anders
"Aras Kucinskas" <aras@.skuba.lt> wrote in message
news:Ot0I694AFHA.3708@.TK2MSFTNGP14.phx.gbl...
> Hi,
> How to convert and transfer ANSI string data from FoxPro table to MS SQL
> Unicode table. Data in FoxPro are in 1251 codepage (Russian Windows). Now
> result is like " 100 ".The ODBC driver does not
> performs the conversion from ANSI to Unicode.
> Help.
>
|||MS SQL usually stores data in CP-1251 for ru_RU locale by default. Your
example here reads as "compressor ring 100 milimeters" in CP-1251 in fact.
Nevertheless, Activex script mechanism doesn't allow codepage translations,
as I was explained here some time ago. You probably need to add some VB /
VB.NET code to your DTS package. Of course, if you do need to translate your
strings.
Nick
"Aras Kucinskas" <aras@.skuba.lt> wrote in message
news:Ot0I694AFHA.3708@.TK2MSFTNGP14.phx.gbl...
> Hi,
> How to convert and transfer ANSI string data from FoxPro table to MS SQL
> Unicode table. Data in FoxPro are in 1251 codepage (Russian Windows).
Now
> result is like " 100 ".The ODBC driver does not
> performs the conversion from ANSI to Unicode.
> Help.
>
|||Thanks Nick,
What functions I can use for string translation?
"Nikolai Lukin" <nvlukin@.gran-service.ru> wrote in message
news:35r898F4pjkqgU1@.individual.net...
> MS SQL usually stores data in CP-1251 for ru_RU locale by default. Your
> example here reads as "compressor ring 100 milimeters" in CP-1251 in fact.
> Nevertheless, Activex script mechanism doesn't allow codepage
translations,
> as I was explained here some time ago. You probably need to add some VB /
> VB.NET code to your DTS package. Of course, if you do need to translate
your[vbcol=seagreen]
> strings.
> Nick
> "Aras Kucinskas" <aras@.skuba.lt> wrote in message
> news:Ot0I694AFHA.3708@.TK2MSFTNGP14.phx.gbl...
SQL[vbcol=seagreen]
> Now
not
>
|||SQL Server stores based on the codepage of the database!
For example:
If your client is using codepage 850 and the database 1250 you will have
automatic conversion.
If your client is using having a ASCII variable stored in codepage 850 and
your stored this in a Unicode column on the server, by default this will get
converted to the server side codepage first. You can also convert it to
Unicode on the client first and insert it, in which case it will got in as
is.
Please read:
International Features in Microsoft SQL Server 2000
http://msdn.microsoft.com/library/en...server2000.asp
PRB: SQL Server ODBC Driver Converts Language Events to Unicode (234748)
http://support.microsoft.com/default...B;EN-US;234748
INF: SQL Server 7.0 BCP and Code Page Conversion (199819)
http://support.microsoft.com/default...B;EN-US;199819
GertD@.SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright SQLDev.Net 1991-2005 All rights reserved.
"Aras Kucinskas" <aras@.skuba.lt> wrote in message
news:O094iWDBFHA.2112@.TK2MSFTNGP09.phx.gbl...
> Thanks Nick,
> What functions I can use for string translation?
> "Nikolai Lukin" <nvlukin@.gran-service.ru> wrote in message
> news:35r898F4pjkqgU1@.individual.net...
> translations,
> your
> SQL
> not
>
|||Here follows some portion of a VB.NET code provided "as is" with absolutely
no warranties. Functions translate a string variable from UTF-8 to ASCII
forth and back. Though code says for itself.
--Quote
Imports System.Text
Public utf8 As Encoding = utf8.UTF8
Public ascii As Encoding = ascii.Default
Public Function Utf8ToAscii(ByVal DataString As String) As String
If DataString = "" Then Return "" Else Return
utf8.GetString(ascii.GetBytes(DataString))
End Function
Public Function AsciiToUtf8(ByVal DataString As String) As String
If DataString = "" Then Return "" Else Return
ascii.GetString(utf8.GetBytes(DataString))
End Function
--Unquote
HTH
Nick
"Aras Kucinskas" <aras@.skuba.lt> wrote in message
news:O094iWDBFHA.2112@.TK2MSFTNGP09.phx.gbl...
> Thanks Nick,
> What functions I can use for string translation?
> "Nikolai Lukin" <nvlukin@.gran-service.ru> wrote in message
> news:35r898F4pjkqgU1@.individual.net...
> translations,
> your
> SQL
> not
>
|||Sorry, this should read as:
> Imports System.Text
> Public utf8 As Encoding = utf8.UTF8
> Public ascii As Encoding = ascii.Default
> Public Function Utf8ToAscii(ByVal DataString As String) As String
> If DataString = "" Then Return "" Else Return
> utf8.GetString(ascii.GetBytes(DataString))
> End Function
> Public Function AsciiToUtf8(ByVal DataString As String) As String
> If DataString = "" Then Return "" Else Return
> ascii.GetString(utf8.GetBytes(DataString))
> End Function
Nick
订阅:
博文评论 (Atom)
没有评论:
发表评论