473,402 Members | 2,064 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,402 software developers and data experts.

encoding again

Hi, sorry that this email is a little bit long, but it is actully not :-))
**** I have a database 'unidb' created with -E UNICODE.

$ psql -l
List of databases
Name | Owner | Encoding
-----------+---------+-----------
unidb | kathy | UNICODE
**** I input Chinese data in unicode form. E.g.
logging-threshold=\u65e5\u5fd7\u9608\u503c
polling_setting_error=\u8bbe\u7f6e\u8f6e\u8be2\u95 f4\u9694\u65f6\u51fa\u9519

unidb=# show client_encoding;
NOTICE: Current client encoding is 'UNICODE'
SHOW VARIABLE

unidb=# select * from testbytes;
name | value
-------------------------+-------------------------
logging_setting_error | 设置æ¥å¿éå¼æ¶åºé
polling_setting_error | 设置轮询é´éæ¶åºé
**** When I retrieve data, I did

unidb=# set client_encoding to 'EUC_CN';
unidb=# show client_encoding;
NOTICE: Current client encoding is 'EUC_CN'
SHOW VARIABLE

unidb=# select * from testbytes order by value;
name | value
-------------------------+-------------------------
logging_setting_error | ־ֵʱ
polling_setting_error | ѯʱ
Three problems here:
1) the sorting is based on unicode value, not EUC_CN encoding value.
2) I wrote the ResultSet to a file by using OutputStreamWriter(file, "EUC_CN"). The
file is not readable from the browser with any charset setting.
3) Changing client_encoding from UNICODE to EUC_CN actually alter/loose the data if
you compare the above "select *" statements.

I wonder why this happens ?? According to the doc, automatic encoding coversion
between UNICODE and EIC_CN is supported.

Any help is highly appreciated.
thanks,
kathy


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #1
2 2034
Kathy Zhu writes:
1) the sorting is based on unicode value, not EUC_CN encoding value.
The sorting is always based on the server encoding. There is no way to
change that.
2) I wrote the ResultSet to a file by using OutputStreamWriter(file, "EUC_CN"). The
file is not readable from the browser with any charset setting.
That is a problem in whatever client interface that is (Java?) or your
browser.
3) Changing client_encoding from UNICODE to EUC_CN actually alter/loose the data if
you compare the above "select *" statements.


You're going to have to be a bit more specific, because many of us can't
identify the characters or see what is wrong with them.

Also, try a more recent PostgreSQL version, such as 7.3.4.

--
Peter Eisentraut pe*****@gmx.net
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 11 '05 #2
Kathy Zhu writes:
1) the sorting is based on unicode value, not EUC_CN encoding value.
The sorting is always based on the server encoding. There is no way to
change that.
2) I wrote the ResultSet to a file by using OutputStreamWriter(file, "EUC_CN"). The
file is not readable from the browser with any charset setting.
That is a problem in whatever client interface that is (Java?) or your
browser.
3) Changing client_encoding from UNICODE to EUC_CN actually alter/loose the data if
you compare the above "select *" statements.


You're going to have to be a bit more specific, because many of us can't
identify the characters or see what is wrong with them.

Also, try a more recent PostgreSQL version, such as 7.3.4.

--
Peter Eisentraut pe*****@gmx.net
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 11 '05 #3

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

Similar topics

18
by: Klaus Alexander Seistrup | last post by:
Hi, After upgrading my Python interpreter to 2.3.1 I constantly get warnings like this: DeprecationWarning: Non-ASCII character '\xe6' in file mumble.py on line 2, but no encoding declared;...
14
by: Dylan | last post by:
Here's what I'm trying to do: - scrape some html content from various sources The issue I'm running to: - some of the sources have incorrectly encoded characters... for example, cp1252...
10
by: Christopher H. Laco | last post by:
Long story longer. I need to get web user input into a backend system that a) only grocks single byte encoding, b) expectes the data transer to be 1 bytes = 1 character, and c) uses the HP Roman-6...
7
by: Mark | last post by:
Hi... I've been doing a lot of work both creating and consuming web services, and I notice there seems to be a discontinuity between a number of the different cogs in the wheel centering around...
8
by: Demon News | last post by:
I'm trying to do a transform (Using XmlTransform class in c#) and in the Transform I'm specifying the the output xsl below: <xsl:output method="xml" encoding="UTF-8" indent="no"/> the...
4
by: Bob | last post by:
Hi Need to produce a Doc with no encoding info. Is there anyway of doing this? Thanks Bob i.e. <?xml version=\"1.0\" ?>
4
by: Provost Zakharov | last post by:
Hello, I just needed some help on how the DOM is decoded by the IE parser. As per the MSDN page, http://msdn.microsoft.com/workshop/author/dhtml/reference/charsets/ch... ,server encodings are...
19
by: Thomas W | last post by:
I'm getting really annoyed with python in regards to unicode/ascii-encoding problems. The string below is the encoding of the norwegian word "fødselsdag". I stored the string as "fødselsdag"...
23
by: Allan Ebdrup | last post by:
I hava an ajax web application where i hvae problems with UTF-8 encoding oc chineese chars. My Ajax webapplication runs in a HTML page that is UTF-8 Encoded. I copy and paste some chineese chars...
14
by: Zoro | last post by:
My task is to read html files from disk and save them onto SQL Server database field. I have created an nvarchar(max) field to hold them. The problem is that some characters, particularly html...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
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...
0
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
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,...

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.