X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 98F4D529AE for ; Fri, 1 Jul 2005 10:08:56 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 93271-09 for ; Fri, 1 Jul 2005 13:08:45 +0000 (GMT) Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) by svr1.postgresql.org (Postfix) with ESMTP id 101EE5298E for ; Fri, 1 Jul 2005 10:08:44 -0300 (ADT) Received: from jfradkin ([66.15.127.235]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IIY00LYB9UNEMO5@vms046.mailsrvcs.net> for pgsql-admin@postgresql.org; Fri, 01 Jul 2005 08:08:48 -0500 (CDT) Date: Fri, 01 Jul 2005 09:09:29 -0400 From: "Joel Fradkin" Subject: encoding converting from ascii to unicode To: Message-id: <000001c57e3e$1e0d2fe0$797ba8c0@jfradkin> MIME-version: 1.0 Content-type: multipart/alternative; boundary="----=_NextPart_000_0001_01C57E1C.96FB8FE0" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.798 tagged_above=0 required=5 tests=AWL, HTML_MESSAGE, MSGID_DOLLARS X-Spam-Level: ** X-Archive-Number: 200507/3 X-Sequence-Number: 18059 This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C57E1C.96FB8FE0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I have been trying to get unicode to work for us (we moved from MSSQL = and had to initially use ascii because it would blow up writing the French = chars when I built my data base). =20 I have a .net app that reads my tables and does insert statements into a Unicode database. The actual conversion is being done with this code: =20 Dim ascii As Encoding =3D Encoding.ASCII Dim [unicode] As Encoding =3D Encoding.Unicode ' Convert the string into a byte[]. Dim asciiBytes As Byte() =3D ascii.GetBytes(asciiString) ' Perform the conversion from one encoding to the other. Dim unicodeBytes As Byte() =3D Encoding.Convert(ascii, = [unicode], asciiBytes) sqltounicode =3D [unicode].GetString(unicodeBytes) =20 So read in ascii and have : Dim cnnunicode As New NpgsqlConnection("Server=3D" + = TextBoxunicodeserver.Text + ";Port=3D5432;User Id=3Dpostgres;Password=3D;Database=3D" + TextBoxunicodedbname.Text + ";Encoding=3DUNICODE;") To open up my Unicode connection that I use for writing. If I observe the string using the debugger it looks like French when I = read it from the ascii database. If I do not convert it, it gives a byte sequence error, If I run the conversion above the French turns into question marks. =20 I am sorry for asking this so many times, but what do I have to do to = get the French to look like French and in the Unicode database. =20 One of my goals is to be able to use the 8.0 odbc drivers which return question marks for French chars (the 7.4 odbc driver does not turn them = into question marks it reads the French ascii ok). =20 Any help is much appreciated. =20 =20 =20 Joel Fradkin =20 Wazagua, Inc. 2520 Trailmate Dr Sarasota, Florida 34243 Tel. 941-753-7111 ext 305 =20 jfradkin@wazagua.com www.wazagua.com Powered by Wazagua Providing you with the latest Web-based technology & advanced tools. C 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc This email message is for the use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized = review, use, disclosure or distribution is prohibited. If you are not the = intended recipient, please contact the sender by reply email and delete and = destroy all copies of the original message, including attachments. =20 =20 =20 ------=_NextPart_000_0001_01C57E1C.96FB8FE0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I have been trying to get unicode to work for us (we = moved from MSSQL and had to initially use ascii because it would blow up = writing the French chars when I built my data base).

 

I have a .net app that reads my tables and does = insert statements into a Unicode database.

The actual conversion is being done with this = code:

 

        Dim ascii = As Encoding =3D = Encoding.ASCII

        Dim = [unicode] As Encoding =3D = Encoding.Unicode

        ' Convert the string = into a byte[].

        Dim = asciiBytes As Byte() =3D = ascii.GetBytes(asciiString)

        ' Perform the conversion = from one encoding to the other.

        Dim = unicodeBytes As Byte() =3D Encoding.Convert(ascii, = [unicode], asciiBytes)

        sqltounicode =3D [unicode].GetString(unicodeBytes)

 

So read in ascii and have :

Dim cnnunicode As New = NpgsqlConnection("Server=3D" + TextBoxunicodeserver.Text + ";Port=3D5432;User = Id=3Dpostgres;Password=3D;Database=3D" + TextBoxunicodedbname.Text + = ";Encoding=3DUNICODE;")

To open up my Unicode connection that I use = for writing.

If I observe the string using the debugger it = looks like French when I read it from the ascii database.

If I do not convert it, it gives a byte = sequence error, If I run the conversion above the French turns into question = marks.

 

I am sorry for asking this so many times, but = what do I have to do to get the French to look like French and in the Unicode = database.

 

One of my goals is to be able to use the 8.0 = odbc drivers which return question marks for French chars (the 7.4 odbc = driver does not turn them into question marks it reads the French ascii = ok).

 

Any help is much = appreciated.

 

 

 

Joel Fradkin

 

Wazagua, Inc.
2520 Trailmate Dr
Sarasota, Florida 34243
Tel.  941-753-7111 ext 305

 

jfradkin@wazagua.com
www.wazagua.com
Powered by Wazagua
Providing you with the latest Web-based technology & advanced = tools.
© 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc
 This email message is for the use of the intended recipient(s) and = may contain confidential and privileged information.  Any unauthorized = review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply email and delete = and destroy all copies of the original message, including = attachments.

 


 

 

------=_NextPart_000_0001_01C57E1C.96FB8FE0--