Skip site navigation (1) Skip section navigation (2)

Re: Character miscount

From: Dave Page <dpage(at)postgresql(dot)org>
To: Erwin Brandstetter <brandstetter(at)falter(dot)at>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Character miscount
Date: 2007-05-08 08:21:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgadmin-hackers
Erwin Brandstetter wrote:
> Hi developers! Hi Dave!
> Testing pgAdmin III v1.6.3 rev: 6112, client Win XP, host: Debian Sarge, 
> PG 8.1.9.
> A pretty useful feature in the SQL query dialogue displays data about 
> the current position of the cursor.
>        Ln 168 Col 30 Ch 7596
> "Ch" supposably stands for "Characters".


> However, it is not the correct character count, but (supposably) the 
> byte-length of the string. Multibyte-characters (like German umlauts ö ä 
> ü) mess with the count. I stumbled across this while trying hard to fix 
> a functions that wouldn't return the right length of a string. Turns 
> out, the function was right, pgAdmin was wrong.

Argh - it's wxSTC::GetCurrentPos() returning the wrong value. I imagine 
it's related to the previous bug which I logged with the wx guys:

> I have reported appearances of this phenomenon in various places (and 
> Dave has fixed them) in the past. Maybe you can identify a typical 
> function or word to look for in all of the source code to find other 
> instances of the beast? (Just a thought.)

The workaround used previously involved wxSTC::SetSelection(), and 
basically not using it any more. Unfortunately there is no similar fix 
that I can think of for this case. I'll add some info on the issue to 
the wx bug and note it in our bugs file. I'm not sure there's much else 
I can do I'm afraid :-(

Thanks for the report though.

Regards, Dave.

In response to

pgadmin-hackers by date

Next:From: svnDate: 2007-05-08 08:22:37
Subject: SVN Commit by dpage: r6266 - trunk/pgadmin3
Previous:From: ivan.pavlovDate: 2007-05-07 10:36:43
Subject: Re: compile problems

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group