From: Joel Fradkin <jfradkin@wazagua.com>
To: pgsql-admin@postgresql.org
Cc: pgsql-odbc@postgresql.org
Subject: Re: encoding converting from ascii to unicode (I got it
Date: Fri, 01 Jul 2005 14:30:11 -0400
Message-ID: <000301c57e6a$eadecbb0$797ba8c0@jfradkin> (raw)
In-Reply-To: <000001c57e3e$1e0d2fe0$797ba8c0@jfradkin>
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 = Encoding.ASCII
Dim [unicode] As Encoding = Encoding.Unicode
Dim unicodeBytes As Byte() = [unicode].GetBytes(asciiString)
sqltounicode = [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=UNICODE;).
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 = "org.postgresql.Driver";
static String url = "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, 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.
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.
-----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
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 = Encoding.ASCII
Dim [unicode] As Encoding = Encoding.Unicode
' Convert the string into a byte[].
Dim asciiBytes As Byte() = ascii.GetBytes(asciiString)
' Perform the conversion from one encoding to the other.
Dim unicodeBytes As Byte() = Encoding.Convert(ascii, [unicode],
asciiBytes)
sqltounicode = [unicode].GetString(unicodeBytes)
So read in ascii and have :
Dim cnnunicode As New NpgsqlConnection("Server=" + TextBoxunicodeserver.Text
+ ";Port=5432;User Id=postgres;Password=;Database=" +
TextBoxunicodedbname.Text + ";Encoding=UNICODE;")
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.
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: jfradkin@wazagua.com, pgsql-odbc@postgresql.org
Subject: Re: encoding converting from ascii to unicode (I got it
In-Reply-To: <000301c57e6a$eadecbb0$797ba8c0@jfradkin>
References: <000001c57e3e$1e0d2fe0$797ba8c0@jfradkin> <000301c57e6a$eadecbb0$797ba8c0@jfradkin>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox