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 3368852956; Fri, 1 Jul 2005 15:29:40 -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 66095-02; Fri, 1 Jul 2005 18:29:30 +0000 (GMT) Received: from vms044pub.verizon.net (vms044pub.verizon.net [206.46.252.44]) by svr1.postgresql.org (Postfix) with ESMTP id 7DE4E52A34; Fri, 1 Jul 2005 15:29:28 -0300 (ADT) Received: from jfradkin ([66.15.127.235]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IIY006KXOP41JP6@vms044.mailsrvcs.net>; Fri, 01 Jul 2005 13:29:29 -0500 (CDT) Date: Fri, 01 Jul 2005 14:30:11 -0400 From: "Joel Fradkin" Subject: Re: encoding converting from ascii to unicode (I got it In-reply-to: <000001c57e3e$1e0d2fe0$797ba8c0@jfradkin> To: Cc: Message-id: <000301c57e6a$eadecbb0$797ba8c0@jfradkin> MIME-version: 1.0 Content-type: multipart/alternative; boundary="----=_NextPart_000_0004_01C57E49.63CD2BB0" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.8 tagged_above=0 required=5 tests=AWL, HTML_MESSAGE, MSGID_DOLLARS X-Spam-Level: ** X-Archive-Number: 200507/6 X-Sequence-Number: 18062 This is a multi-part message in MIME format. ------=_NextPart_000_0004_01C57E49.63CD2BB0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I finally got it to work. I tested the unicode database with the newer = odbc drivers as well. It is working ok as far asp pages now. =20 Dim ascii As Encoding =3D Encoding.ASCII Dim [unicode] As Encoding =3D Encoding.Unicode Dim unicodeBytes As Byte() =3D [unicode].GetBytes(asciiString) sqltounicode =3D [unicode].GetString(unicodeBytes)=20 =20 This worked in a .net app using ascii (do not specify the encoding on = this connection) read and Unicode write (specify Encoding=3DUNICODE;). =20 Any one know if I will run into any other issues using a unicode = database (is sqlascii now). I use zeos for Delphi, and Java I use: static String driver =3D "org.postgresql.Driver"; static String url =3D = "jdbc:postgresql://192.168.123.121/wazagua"; =20 Just want to make sure my .net, asp , java and Delphi stuff will not = break switching to Unicode. I am switching because I hope the new odbc drivers work better for us = (we have seen IIS crash from time to time, where we did not before switching = to postgres). =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 -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Joel Fradkin Sent: Friday, July 01, 2005 8:09 AM To: pgsql-admin@postgresql.org Subject: [ADMIN] encoding converting from ascii to unicode =20 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_0004_01C57E49.63CD2BB0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I finally got it to work. I tested = the unicode database with the newer odbc drivers as well.

It is working ok as far asp pages = now.

 

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

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

        Dim = unicodeBytes As Byte() =3D = [unicode].GetBytes(asciiString)

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

 

This worked in a .net app using = ascii (do not specify the encoding on this connection) read and Unicode write = (specify Encoding=3DUNICODE;).

 

Any one know if I will run into any other = issues using a unicode database (is sqlascii now).

I use zeos for Delphi, and

Java I use:

      =       static String driver =3D "org.postgresql.Driver";

      =       static String url =3D = "jdbc:postgresql://192.168.123.121/wazagua";

 

Just want to make sure my .net, asp = , java and Delphi stuff will not break switching to = Unicode.

I am switching because I hope the = new odbc drivers work better for us (we have seen IIS crash from time to time, = where we did not before switching to postgres).

 

 

Joel Fradkin

 

Wazagua, Inc.
2520 Trailmate Dr
Sarasota, F
lorida 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.

 


 

-----Original = Message-----
From: pgsql-admin-owner@postgresql.org = [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of
Joel = Fradkin
Sent: Friday, July 01, = 2005 8:09 AM
To:
pgsql-admin@postgresql.org<= /span>
Subject: [ADMIN] encoding converting from ascii to unicode

 

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_0004_01C57E49.63CD2BB0--