"Serge Orlov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> It can be like this. Notice special url, it is pointing to a
> non-existing :) tutorial about why concatenating byte strings with
> unicode strings can produce UnicodeDecodeError
An alternate is to give an error code that
ChaosKCW wrote:
> Ok I get it now. Sorry for the slowness. I have to say as a lover of
> python for its simplicity and clarity, the charatcer set thing has been
> harder than I would have liked to figure out.
I think there is a room for improvement here. In my opinion the message
is too confusing
>
> When python tries to concatenate a byte string and a unicode string, it
> assumes that the byte string is encoded ascii and tries to convert from
> encoded ascii to unicode. It calls ascii decoder to do the decoding. If
> decoding fails you see message from ascii decoder about the error.
>
>
ChaosKCW wrote:
> >
> > There's an Oracle environment variable that appears to make a
> > difference: NLS_CHARSET, perhaps - it's been a while since I've had to
> > deal with Oracle, and I'm not looking for another adventure into
> > Oracle's hideous documentation to find out.
>
> That is an EVIL s
ChaosKCW wrote:
> Roger Binns wrote:
>
> >
> > No. APSW converts it *to* Unicode. SQLite only accepts Unicode
> > so a Unicode string has to be supplied. If you supply a non-Unicode
> > string then conversion has to happen. APSW asks Python to
> > supply the string in Unicode. If Python can't
>
> There's an Oracle environment variable that appears to make a
> difference: NLS_CHARSET, perhaps - it's been a while since I've had to
> deal with Oracle, and I'm not looking for another adventure into
> Oracle's hideous documentation to find out.
>
That is an EVIL setting which should not be
Roger Binns wrote:
>
> No. APSW converts it *to* Unicode. SQLite only accepts Unicode
> so a Unicode string has to be supplied. If you supply a non-Unicode
> string then conversion has to happen. APSW asks Python to
> supply the string in Unicode. If Python can't do that (eg
> it doesn't kno
Roger Binns wrote:
> "Serge Orlov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> > I have an impression that handling/production of byte order marks is
> > pretty clear: they are produced/consumed only by two codecs: utf-16 and
> > utf-8-sig. What is not clear?
>
> Are you talking
"Serge Orlov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> I have an impression that handling/production of byte order marks is
> pretty clear: they are produced/consumed only by two codecs: utf-16 and
> utf-8-sig. What is not clear?
Are you talking about the C APIs in Python/SQL
Roger Binns wrote:
> "Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> > Roger Binns wrote:
> >
> >> SQLite only accepts Unicode so a Unicode string has to be supplied.
> >
> > fact or FUD? let's see:
>
> Note I said SQLite. For APIs that take/give strings, you can eit
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> sounds like your understanding of Unicode and Python's Unicode system
> is a bit unclear.
Err, no. Relaying unicode data between two disparate
C APIs requires being careful and thorough. That means
paying attention to
Roger Binns wrote:
> > fact or FUD? let's see:
>
> Note I said SQLite. For APIs that take/give strings, you can either
> supply/get a UTF-8 encoded sequence of bytes, or two bytes per character
> host byte order sequence. Any wrapper of SQLite that doesn't do
> Unicode in/out is seriously break
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Roger Binns wrote:
>
>> SQLite only accepts Unicode so a Unicode string has to be supplied.
>
> fact or FUD? let's see:
Note I said SQLite. For APIs that take/give strings, you can either
supply/get a UTF-8 encoded se
Roger Binns wrote:
> SQLite only accepts Unicode so a Unicode string has to be supplied.
fact or FUD? let's see:
import pysqlite2.dbapi2 as DB
db = DB.connect("test.db")
cur = db.cursor()
cur.execute("create table if not exists test (col text)")
cur.execute("insert into t
"ChaosKCW" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> me. As for SQLite supporting unicode, it probably does,
No, SQLite *ONLY* supports Unicode. It will *only* accept
strings in Unicode and only produces strings in Unicode.
All the functionality built into SQLite such as comp
Robert Kern wrote:
> Roger Binns wrote:
> > "Paul Boddie" <[EMAIL PROTECTED]> wrote
> >>It looks like you may have Unicode objects that you're presenting to
> >>sqlite. In any case, with earlier versions of pysqlite that I've used,
> >>you need to connect with a special unicode_results parameter,
Roger Binns wrote:
> "Paul Boddie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>
>>It looks like you may have Unicode objects that you're presenting to
>>sqlite. In any case, with earlier versions of pysqlite that I've used,
>>you need to connect with a special unicode_results para
"Thus you lose data, but thats just dandy with
me.": Please reconsider this attitude, before you perpetrate a nonsense
or even a disaster.
Wrt your last para:
1. Roger didn't say "ignore" -- he said "won't accept" (a major
difference).
2. The ASCII code comprises 128 characters, *NOT* 256.
3. What
Hi
Thanks for all the posts. I am still digesting it all but here are my
initial comments.
>Don't. You can't. Those characters don't exist in the ASCII character set.
>SQLite 3.0 deals with UTF-8 encoded SQL statements, though.
>http://www.sqlite.org/version3.html
As mentioned by the next poster
"Paul Boddie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> It looks like you may have Unicode objects that you're presenting to
> sqlite. In any case, with earlier versions of pysqlite that I've used,
> you need to connect with a special unicode_results parameter,
He is using apsw
Oh, and it occurs to me, as I seem to have mentioned a document about
PgSQL rather than pysqlite (although they both have the same principal
developer), that you might need to investigate the client_encoding
parameter when setting up your connection. The following message gives
some information (bu
> Don't. You can't. Those characters don't exist in the ASCII character set.
> SQLite 3.0 deals with UTF-8 encoded SQL statements, though.
That is not entirely correct - one can, if losing information is ok. The OPs
code that normalized UTF-8 to NFKD, an umlaut like รค is transformed to a
two-chara
ChaosKCW wrote:
> Hi
>
> I am reading from an oracle database using cx_Oracle. I am writing to a
> SQLite database using apsw.
>
> The oracle database is returning utf-8 characters for euopean item
> names, ie special charcaters from an ASCII perspective.
I'm not sure that you are using those te
ChaosKCW wrote:
> Hi
>
> I am reading from an oracle database using cx_Oracle. I am writing to a
> SQLite database using apsw.
>
> The oracle database is returning utf-8 characters for euopean item
> names, ie special charcaters from an ASCII perspective.
And does cx_Oracle return those as Unicode
Hi
I am reading from an oracle database using cx_Oracle. I am writing to a
SQLite database using apsw.
The oracle database is returning utf-8 characters for euopean item
names, ie special charcaters from an ASCII perspective.
I get the following error:
>SQLiteCur.execute(sql, row)
>UnicodeDe
25 matches
Mail list logo