473,804 Members | 3,464 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UNICODE-encoded database does not accept umlaut-characters.

Created a new 7.4 database.
# create database foo with encoding = UNICODE;
Then tried to restore my dump from pg 7.2 which was SQL-ASCII or Latin1
encoded (cant tell which of the two, only got the dump of the old database
left after upgrading postgresql.)
Succeeded creating the objects, but no data was restored, instead
postgresql complained about illegal UNICODE characters. Also export of an
MS-Access Database with pgAdmin 1.6 failed with the same errors.

Created a new database with encoding = Latin1. Everything worked fine.

This is a shame, as UNICODE was chosen to avoid future problems with exotic
characters. But I cant get it working because of this very problem!

Is this a bug? Any workarounds?

Regards & TIA
Erwin

--
no z in my mail.
Nov 22 '05 #1
3 4423
Erwin Brandstetter <Br***@gmzx.a t> writes:
Created a new 7.4 database.
# create database foo with encoding = UNICODE;
Then tried to restore my dump from pg 7.2 which was SQL-ASCII or Latin1
encoded (cant tell which of the two, only got the dump of the old database
left after upgrading postgresql.)
Succeeded creating the objects, but no data was restored, instead
postgresql complained about illegal UNICODE characters.


Yeah; by default PG will assume that you are sending it UNICODE data
if that's what the database encoding is.

You can arrange for conversion to occur by adding
set client_encoding = latin1;
at the top of the dump file.

regards, tom lane

---------------------------(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 22 '05 #2
Hi Tom, hi NG!

Tom Lane wrote:
Yeah; by default PG will assume that you are sending it UNICODE data
if that's what the database encoding is.

You can arrange for conversion to occur by adding
set client_encoding = latin1;
at the top of the dump file.


First, thanx for the hint! Tried it, but no success. Here is what I did:

I altered my dump-file, so that it looks like this now:

--
-- pg_dumpall (7.2.1)
--
set client_encoding = latin1;

\connect template1
(...)

Then I created a new db cluster with initdb:

# initdb --encoding = UNICODE

Then I created each database, there was before, but now with UNICODE
encoding.
Then I tried to restore:

# psql template1 < my_dump_file
I got UNICODE errores again:
ERROR: Unicode characters greater than or equal to 0x10000 are not
supported
ERROR: invalid byte sequence for encoding "UNICODE": 0xe46e67
What am I doing wrong?
I am using the postgresql 7.4 debian woody backport, provided by Oliver
Elphick. That is, i was using it, i have messed it all up while trying to
reinstall - this goes into another post ..
Regards
Erwin Brandstetter

--
no z in my mail.
Nov 22 '05 #3
Erwin Brandstetter (myself) wrote in message
First, thanx for the hint! Tried it, but no success. Here is what I did:

(...)

After facing various problems with my installation of postgresql 7.4 I
decided to do a complete re-install (got strange errors when trying to
vacuum, for one).
Now, that finally everything is up and running again, I tried it again
the way Tom has pointed out to me, and .. voilá: it works. Goes off
without a hitch.

One hint, if u should be in a similar situation: Don't forget to set
client_encoding = Latin1 (or whatever is appropriate) for any client
client that does not make use of UNICODE.

Thanks once more to Tom & regards!
Erwin Brandstetter
Nov 22 '05 #4

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

Similar topics

4
6073
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3 script that grabs some web pages from the web, regex parse the data and stores it localy to xml file for further use.. at first i had no problem using python minidom and everything concerning
10
8113
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
10
2234
by: Larry Hastings | last post by:
I'm an indie shareware Windows game developer. In indie shareware game development, download size is terribly important; conventional wisdom holds that--even today--your download should be 5MB or less. I'd like to use Python in my games. However, python24.dll is 1.86MB, and zips down to 877k. I can't afford to devote 1/6 of my download to just the scripting interpreter; I've got music, and textures, and my own crappy code to ship. ...
5
2505
by: wanghz | last post by:
Hello, everyone. I have a problem when I'm processing unicode strings. Is it possible to get the 8bit-string representation of any unicode string? Suppose I get a unicode string: a = u'\xc8\xce\xcf\xcd\xc6\xeb'; then, by a.encode('latin-1'); I can get the 8bit-string representation of it, that is, the physical
1
1600
by: maport | last post by:
The behavior of the unicode built-in function when given a unicode string seems a little odd to me: u'abc' Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: decoding Unicode is not supported I don't see why providing the encoding should make the function behave
13
2972
by: gabor | last post by:
hi, from the documentation (http://docs.python.org/lib/os-file-dir.html) for os.listdir: "On Windows NT/2k/XP and Unix, if path is a Unicode object, the result will be a list of Unicode objects." i'm on Unix. (linux, ubuntu edgy)
5
3035
by: Holger Joukl | last post by:
Hi there, I consider the behaviour of unicode() inconvenient wrt to conversion of non-string arguments. While you can do: u'17.3' you cannot do:
2
2140
by: John Nagle | last post by:
Regular expressions are compiled in ASCII mode unless Unicode mode is specified to "rc.compile". The difference is that regular expressions in ASCII mode don't recognize things like Unicode whitespace, even when applied to Unicode strings. For example, Unicode character 0x00A0 is a "NO-BREAK SPACE", which is a form of whitespace. It's the Unicode equivalent of HTML's "&nbsp;". This can create some strange bugs. Is the current default...
2
4043
by: John Nagle | last post by:
Here's a strange little bug. "socket.getaddrinfo" blows up if given a bad domain name containing ".." in Unicode. The same string in ASCII produces the correct "gaierror" exception. Actually, this deserves a documentation mention. The "socket" module, given a Unicode string, calls the International Domain Name parser, "idna.py", which has a a whole error system of its own. The IDNA documentation says that "Furthermore, the socket...
5
1987
by: =?Utf-8?B?Q3JhaWcgSm9obnN0b24=?= | last post by:
I am in the process of converting an application to Unicode that is built with Visual C++ .NET 2003. On application startup in debug mode I get an exception. The problem appears to be that code with #ifndef _UNICDODE is executed in output.c, the library code for supporting printf functions. I need to how to get the code that is defined with _UNICODE to be executed instead. I have defined the _UNICODE constant in the project Properties and...
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10562
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10070
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2978
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.