473,513 Members | 3,949 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

encoding and parser: error?

Hi list

I am working with postgresql 7.1.3 and 7.3.4 and German characters. I
use only unicode databases.

When importing data from iso-latin-1 via psql I tried
drop table test;
create table test(nr int, text1 text, text2 text) ;
set client_encoding to 'latin1';
insert into test values(0,'these are all','German characters');
insert into test values(1,'--','abcäöüÄÖÜß');
insert into test values(2,'we insert','one German character');
insert into test values(3,'e.g.','ö');
insert into test values(4,'we insert','two German character');
insert into test values(5,'e.g.','öü');
so far ok, but when I try
insert into test values(6,'we insert','a very special address');
insert into test values(7,'----','6 /6,Basinköy');

I got the prompt like
test1'#
telling me that some ' seems missing.

When I ignore that and continue
insert into test values(8,'again','two German characters');
insert into test values(9,'e.g.','öü');
select * from test;

everything seems OK !!

Moreover, when I use the metacommand

/encoding latin1
instead of the "set client_encoding" SQLcommand (which should be
equivalent,
everything goes OK right from the beginning.

Why? Some parser error?

Thank you for your help.

Regards,

Hubert


--
-------------------------------------------------------------------------------
Dr.-Ing. Hubert Fröhlich
Bezirksfinanzdirektion München
Alexandrastr. 3, D-80538 München, GERMANY
Tel. :+49 (0)89 / 2190 - 2980
Fax :+49 (0)89 / 2190 - 2459
hu**************@bvv.bayern.de
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #1
1 1685
=?ISO-8859-1?Q?Hubert_Fr=F6hlich?= <hu**************@bvv.bayern.de> writes:
Moreover, when I use the metacommand /encoding latin1
instead of the "set client_encoding" SQLcommand (which should be
equivalent,
everything goes OK right from the beginning.


They should be equivalent, but they are not --- psql needs to know the
encoding, and when you use SET it doesn't. (This is fixed for 7.4.)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 11 '05 #2

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

Similar topics

2
5326
by: Gustaf Liljegren | last post by:
I'm using xml.sax.parseString to read an XML file. The XML file contains a few words in Russian, and is encoded in UTF-8 using C#. In the example below, MyParser() is my SAX ContentHandler class. My first try was: f = open('words.xml', 'r') s = f.read() xml.sax.parseString(s, MyParser()) This produced the following error:
2
2047
by: Sylvain Thenault | last post by:
Hi there ! I've noticed the following problem with python >= 2.3 (actually 2.3.4 and 2.4): syt@musca:test$ python Python 2.3.4 (#2, Sep 24 2004, 08:39:09) on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import parser >>> parser.suite('# -*- coding: IBO-8859-1 -*-')
1
27671
by: Vlajko Knezic | last post by:
Not so sure what is going on here but is something to do with the way UTF8 is handled in Perl and/or LibXML The sctript below: - accepts a value from a form text field; - builds XML document around it,
1
5685
by: Matt | last post by:
It has no error if I use <?xml version="1.0" encoding="utf-8" ?> in XML declaration. But if I use <?xml version="1.0" encoding="ISO-8859-1"?> It will produce error: The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. Switch from current...
0
1226
by: icoba | last post by:
Hi, I am parsing html documents using the html parser from libxml2, and if the encoding is included in the document it works perfectly but if it is not, I think it does not work well (probably because I am doing something wrong). As it is said in http://xmlsoft.org/encoding.html the parser should detect the encoding. So I tested it...
15
5397
by: Steven Bethard | last post by:
I'm having trouble using elementtree with an XML file that has some gbk-encoded text. (I can't read Chinese, so I'm taking their word for it that it's gbk-encoded.) I always have trouble with encodings, so I'm sure I'm just screwing something simple up. Can anyone help me? Here's the interactive session. Sorry it's a little verbose, but...
0
1391
by: kellner | last post by:
Hello, I'm parsing a chunk of XML code and would like to add attribute values to individual tags if these are lacking. This is with perl 5.8.6, libxml2 2.6.17, XML::LibXML 1.58. Basically, I have the parser add the attribute values to the respective nodes and then use the toString method of XML::LibXML::Document to write the modified...
19
2554
by: Edward K. Ream | last post by:
Following the usual cookbook examples, my app parses an open file as follows:: parser = xml.sax.make_parser() parser.setFeature(xml.sax.handler.feature_external_ges,1) # Hopefully the content handler can figure out the encoding from the <?xml>
6
3087
by: kath | last post by:
Hi all, Platform: winxp Version: Python 2.3 I have a task of reading files in a folder and creating an one excel file with sheets, one sheet per file, with sheet named as filename. I am facing problem in handling special characters. I am using XLRD and XLW package to read/write from/to file. But facing problem in...
6
4530
by: saumya.agarwal | last post by:
Hi, I am using libxml2 for xml parsing. When the client application sends data to libxml2 in UTF-8 format, it works fine. But, I have a scenarion in which the client application sends data to libxml2 parser in SHIFT-JIS format. The following error is thrown by libxml2 -
0
7270
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...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
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. ...
1
7125
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7543
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...
0
4757
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...
0
3239
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
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
0
470
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...

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.