On Mar 4, 1:00 pm, NickC <[EMAIL PROTECTED]> wrote:
>
> Python 3.0a3+ (py3k:61229, Mar 4 2008, 21:38:15)
> [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>>
> r"\u"
> '\\u'
> >>> r"\uparrow"
> '\\uparro
On Feb 26, 8:45 am, rmano <[EMAIL PROTECTED]> wrote:
> BTW, 2to3.py should warn when a raw string (not unicode) with \u in
> it, I think.
> I tried it and it seems to ignore the problem...
Python 3.0a3+ (py3k:61229, Mar 4 2008, 21:38:15)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)]
On Feb 25, 11:27 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> > Raw
> > should be raw...
>
> Right. IMO, this is just a plain design mistake in the Python Unicode
> handling. Unfortunately, there was discussion about this specific issue
> in the past, and the proponent of the status quo alway
> Yes, I think I will do something like that, although... I really do
> not understand why \x5c is not interpreted in a raw string but \u005c
> is interpreted in a unicode raw string... is, well, not elegant. Raw
> should be raw...
Right. IMO, this is just a plain design mistake in the Python Uni
On Feb 25, 6:03 pm, "OKB (not okblacke)"
<[EMAIL PROTECTED]> wrote:
>
> I too encountered this problem, in the same situation (making
> strings that contain LaTeX commands). One possibility is to separate
> out just the bit that has the \u, and use string juxtaposition to attach
> it to th
Romano Giannetti wrote:
> Hi,
>
> while writing some LaTeX preprocessing code, I stumbled into this
> problem: (I have a -*- coding: utf-8 -*- line, obviously)
>
> s = ur"añado $\uparrow$"
>
> Which gave an error because the \u escape is interpreted in raw
> unicode strings, too. So I found
> unicode(r"\uparrow", "utf-8") will break... sigh.
>
Moreover, I checked with 2to3.py, and it say (similar case):
-ok_preamble = unicode(r"""
+ok_preamble = str(r"""
\usepackage[utf8]{inputenc}
\begin{document}
Añadidos:
""", "utf-8")
which AFAIK will give an error for the \u in \usepackag
Thinker branda.to> writes:
>
>
> > s = ur"añado $\uparrow$"
> >
> > Which gave an error because the \u escape is interpreted in raw
> > unicode strings, too. So I found that the only way to solve this is
> > to write:
> >
> > s = unicode(r"añado $\uparrow$", "utf-8")
> >
> > or
> >
> > s = ur"
Romano Giannetti wrote:
> Hi,
>
> while writing some LaTeX preprocessing code, I stumbled into this
> problem: (I have a -*- coding: utf-8 -*- line, obviously)
>
> s = ur"añado $\uparrow$"
>
> Which gave an error because the \u escape is interpreted in raw
> unicode strings, too. So I found that th
Romano Giannetti wrote:
> Hi,
>
> while writing some LaTeX preprocessing code, I stumbled into this problem:
> (I have a -*- coding: utf-8 -*- line, obviously)
>
> s = ur"añado $\uparrow$"
>
> Which gave an error because the \u escape is interpreted in raw unicode
> strings, too. So I found tha
Hi,
while writing some LaTeX preprocessing code, I stumbled into this problem: (I
have a -*- coding: utf-8 -*- line, obviously)
s = ur"añado $\uparrow$"
Which gave an error because the \u escape is interpreted in raw unicode strings,
too. So I found that the only way to solve this is to write
11 matches
Mail list logo