473,440 Members | 1,776 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,440 software developers and data experts.

convert database to unicode

Hello, I want to convert an existing database with
SQL_ASCII encoding to UNICODE encoding.

(postgresql ver 7.3.2)

I thought that it might be as easy as:
pg_dump mydatabase > dump.sql
createdb --encoding=unicode newdatabase
psql newdatabase < dump.sql

but it wasn't going to be that easy now was it :-(

I'm getting errors such as:
ERROR: copy: line 54, Invalid UNICODE character
sequence found (0xe46765)
lost synchronization with server, resetting connection

Can anyone suggest a way I might be able to do it?
Thanks, David
http://search.yahoo.com.au - Yahoo! Search
- Looking for more? Try the new Yahoo! Search

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 11 '05 #1
2 9280
David Lutz wrote:
Hello, I want to convert an existing database with
SQL_ASCII encoding to UNICODE encoding.

(postgresql ver 7.3.2)

I thought that it might be as easy as:
pg_dump mydatabase > dump.sql
createdb --encoding=unicode newdatabase
psql newdatabase < dump.sql

but it wasn't going to be that easy now was it :-(

I'm getting errors such as:
ERROR: copy: line 54, Invalid UNICODE character
sequence found (0xe46765)
lost synchronization with server, resetting connection

Can anyone suggest a way I might be able to do it?
Thanks, David


You *might* be able to convert dump.sql to unicode.

i.e.

iconv -f iso8859-1 -t utf-8 < dump.sql > dump-utf-8.sql

If all the bytea chars are appropriately escaped, this may do it.

Can't harm in giving it a go !



---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 11 '05 #2
--- Gianni Mariani <gi****@mariani.ws> wrote: > David
Lutz wrote:
Hello, I want to convert an existing database with
SQL_ASCII encoding to UNICODE encoding.

(postgresql ver 7.3.2)

I thought that it might be as easy as:
pg_dump mydatabase > dump.sql
createdb --encoding=unicode newdatabase
psql newdatabase < dump.sql

You *might* be able to convert dump.sql to unicode.

i.e.

iconv -f iso8859-1 -t utf-8 < dump.sql >
dump-utf-8.sql

If all the bytea chars are appropriately escaped,
this may do it.

Can't harm in giving it a go !


Thanks Gianni, yes that appears to have worked.
I didn't know about the iconv command.

Cheers, David

http://search.yahoo.com.au - Yahoo! Search
- Looking for more? Try the new Yahoo! Search

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 11 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rodger Dodger | last post by:
Hi there. We have an application that can run on a non-unicode or a unicode sql server database. Currently the application is running in a unicode database, as a non-unicode database is less...
3
by: hunterb | last post by:
I have a file which has no BOM and contains mostly single byte chars. There are numerous double byte chars (Japanese) which appear throughout. I need to take the resulting Unicode and store it in a...
1
by: Adam | last post by:
Hello, I'm trying to decifer the data in the table that stores the data in the binary format. All numbers are placed in varbinary fields. All I know is the MS SQL 2000 database useing collation...
3
by: culley harrelson | last post by:
It seems to me that these values should be the same: select 'lydia eugenia treviño', convert('lydia eugenia treviño' using ascii_to_utf_8); but they seem to be different. What am I missing? ...
5
by: DbNetLink | last post by:
I am trying to convert some Japanese text encoded as Shift-JIS/ISO-2022-JP to UTF-8 so I can store all data in my database with a common encoding. My problem is the encoding conversion code works...
0
by: mohankumar11 | last post by:
hi..i am having ms sql server 2005...now we are in upgrading process... in that database is unicode but the tables are not unicode... the tables are in non-unicode..tell me how to convert the tables...
0
by: deloford | last post by:
Hi This is going to be a question for anyone who is an expert in C# Text Encoding. My situation is this: I have a Sybase database which is firing back ISO-8559 encoded strings. I am unable to...
0
by: M.-A. Lemburg | last post by:
On 2008-07-01 20:31, Peter Bulychev wrote: You could write a codec which translates Unicode into a ASCII lookalike characters, but AFAIK there is no standard for doing this. I guess the best...
2
by: neovantage | last post by:
hey geeks, I am using a function which convert unicode to entities. So that i can save values into mysql database into entities. This function really helps me when i display the store entity data...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.