[issue13432] Encoding alias unicode

2011-11-25 Thread kxroberto

kxroberto kxrobe...@users.sourceforge.net added the comment:

I wonder where is the origin, who is the inventor of the frequent 
charset=unicode? But:


Sorry, but it's not obviously that Unicode means UTF-8.

When I faced
meta content=text/html; charset=unicode http-equiv=Content-Type/
the first time on the web, I guessed it is UTF-8 without looking. It even 
sounds colloquially reasonable ;-)  And its right 99.999% of cases. 
(UTF-16 is less frequent than this non-canonical unicode)


Definitely; this will just serve to create more confusion for beginners over 
what a Unicode string is:
unicodestring.encode('unicode')   - WTF?

I guess no python tutorial writer or encoding menu writer poses that example. 
That string comes in on technical paths:  web, MIME etc.
In the aliases.py there are many other names which are not canonical. frequency 
 convenience  alias


Joining the chorus: people who need it in their application will have to add 
it themselves (monkeypatching the aliases dictionary as appropriate).

Those people first would need to be aware of the option: Be all-seeing, or all 
wait for the first bug reports ...  


Reverse question: what would be the minus of having this alias?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13432
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13432] Encoding alias unicode

2011-11-25 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 meta content=text/html; charset=unicode http-equiv=Content-Type/

Python is not a language written for the web, it's generic language to program 
anything! If you have a problem to parse an HTML page, the special case should 
be added to the HTML parser, not to the language.

Do you have the encoding issue with a parser included in Python 
(html.parser.*)? If you have the issue with an third-party parser, you have to 
report the bug there.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13432
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13432] Encoding alias unicode

2011-11-25 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

The mapping unicode - utf-8 is simply not defined unambiguously, in 
addition to being factually wrong. For example, when Microsoft talks about 
Unicode they mean UTF-16.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13432
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13432] Encoding alias unicode

2011-11-25 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 For example, when Microsoft talks about Unicode they mean UTF-16.

Sorry, but UTF-16 is ambiguously: do you mean UTF-16-LE or UTF-16-BE? ;-)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13432
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13432] Encoding alias unicode

2011-11-25 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 Reverse question: what would be the minus of having this alias?

Please accept that this issue is closed.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13432
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13432] Encoding alias unicode

2011-11-19 Thread kxroberto

New submission from kxroberto kxrobe...@users.sourceforge.net:

unicode seems not to be an official unicode encoding name alias.
Yet it is quite frequent on the web - and obviously means UTF-8. 
(search 'text/html; charset=unicode' in Google)
Chrome and IE display it as UTF-8.  (Mozilla as ASCII, thus mixed up chars).

Should it be added in to aliases.py ?

--- ./aliases.py
+++ ./aliases.py
@@ -511,6 +511,7 @@
 'utf8'   : 'utf_8',
 'utf8_ucs2'  : 'utf_8',
 'utf8_ucs4'  : 'utf_8',
+'unicode': 'utf_8',
 
 # uu_codec codec
 'uu' : 'uu_codec',

--
messages: 147936
nosy: kxroberto
priority: normal
severity: normal
status: open
title: Encoding alias unicode

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13432
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13432] Encoding alias unicode

2011-11-19 Thread kxroberto

Changes by kxroberto kxrobe...@users.sourceforge.net:


--
components: +Unicode
nosy: +ezio.melotti
type:  - feature request
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13432
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13432] Encoding alias unicode

2011-11-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Sorry, but it's not obviously that Unicode means UTF-8.

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13432
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13432] Encoding alias unicode

2011-11-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Definitely; this will just serve to create more confusion for beginners over 
what a Unicode string is:

unicodestring.encode('unicode')   - WTF?

--
nosy: +georg.brandl
resolution:  - rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13432
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13432] Encoding alias unicode

2011-11-19 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Joining the chorus: people who need it in their application will have to add it 
themselves (monkeypatching the aliases dictionary as appropriate).

--
nosy: +loewis

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13432
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13432] Encoding alias unicode

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
stage:  - committed/rejected
versions:  -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13432
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com