bugfix: Encoding of config files

Поиск
Список
Период
Сортировка
Искать

bugfix: Encoding of config files

От:
"Magnus Hagander" <mha@sollentuna.net>
Дата:
Вложения:
Hi!


Seems the config files are read as ASCII but written as UTF8. I don't
think you'd normally see non-ascii characters in the values, but I
definitly have them in the comments somewhere. And things should at
least be consistent.

Attached patch reads the file as UTF8, and doesn't change the writing.

//Magnus

Re: bugfix: Encoding of config files

От:
"Dave Page" <dpage@vale-housing.co.uk>
Дата:
Thanks, patch applied to 1.4.x and 1.6. 

> -----Original Message-----
> From: pgadmin-hackers-owner@postgresql.org 
> [mailto:pgadmin-hackers-owner@postgresql.org] On Behalf Of 
> Magnus Hagander
> Sent: 23 January 2006 11:33
> To: pgadmin-hackers@postgresql.org
> Subject: [pgadmin-hackers] bugfix: Encoding of config files
> 
> Hi!
> 
> 
> Seems the config files are read as ASCII but written as UTF8. I don't
> think you'd normally see non-ascii characters in the values, but I
> definitly have them in the comments somewhere. And things should at
> least be consistent.
> 
> Attached patch reads the file as UTF8, and doesn't change the writing.
> 
> //Magnus
> 

Re: bugfix: Encoding of config files

От:
Andreas Pflug <pgadmin@pse-consulting.de>
Дата:
Dave Page wrote:

>Thanks, patch applied to 1.4.x and 1.6. 
>  
>

Hm, this certainly should be consistent, but I'd guess most files will 
use a 1-byte system charset, not UTF8, thus wxConvLibc not wxConvUTF8 is 
the right one.

Regards,
Andreas

Re: bugfix: Encoding of config files

От:
"Magnus Hagander" <mha@sollentuna.net>
Дата:
> >Thanks, patch applied to 1.4.x and 1.6. 
> >  
> >
> 
> Hm, this certainly should be consistent, but I'd guess most 
> files will use a 1-byte system charset, not UTF8, thus 
> wxConvLibc not wxConvUTF8 is the right one.

I for one certainly bow to that one. As said before, the encodings
dealings is defintily not my strong side :-)

//Magnus

Re: bugfix: Encoding of config files

От:
Andreas Pflug <pgadmin@pse-consulting.de>
Дата:
Magnus Hagander wrote:

>>>Thanks, patch applied to 1.4.x and 1.6. 
>>> 
>>>
>>>      
>>>
>>Hm, this certainly should be consistent, but I'd guess most 
>>files will use a 1-byte system charset, not UTF8, thus 
>>wxConvLibc not wxConvUTF8 is the right one.
>>    
>>
>
>I for one certainly bow to that one. As said before, the encodings
>dealings is defintily not my strong side :-)
>  
>

Well, itsapita. Nobody likes to deal with it voluntarily... :-)

Regards,
Andreas

Re: bugfix: Encoding of config files

От:
Dave Page <dpage@vale-housing.co.uk>
Дата:



On 23/1/06 18:53, "Magnus Hagander"  wrote:

>>> Thanks, patch applied to 1.4.x and 1.6.
>>>  
>>> 
>> 
>> Hm, this certainly should be consistent, but I'd guess most
>> files will use a 1-byte system charset, not UTF8, thus
>> wxConvLibc not wxConvUTF8 is the right one.
> 
> I for one certainly bow to that one. As said before, the encodings
> dealings is defintily not my strong side :-)

Ditto. Will commit the change.

/D

Re: bugfix: Encoding of config files

От:
"Dave Page" <dpage@vale-housing.co.uk>
Дата:
Вложения:
 

> -----Original Message-----
> From: Andreas Pflug [mailto:pgadmin@pse-consulting.de] 
> Sent: 23 January 2006 23:31
> To: Dave Page
> Cc: Magnus Hagander; pgadmin-hackers@postgresql.org
> Subject: Re: [pgadmin-hackers] bugfix: Encoding of config files
> 
> 
> NB, when reading AND writing!
> And the wxUtfFile class will behave differently when creating 
> a file or 
> rewriting (will preserve encoding in the latter case)

Err, ok. Well, how does the attached look o'Guru of encoding and such
things?

Regards, Dave.

Re: bugfix: Encoding of config files

От:
Andreas Pflug <pgadmin@pse-consulting.de>
Дата:
Dave Page wrote:
>  
> 
> 
>>-----Original Message-----
>>From: Andreas Pflug [mailto:pgadmin@pse-consulting.de] 
>>Sent: 23 January 2006 23:31
>>To: Dave Page
>>Cc: Magnus Hagander; pgadmin-hackers@postgresql.org
>>Subject: Re: [pgadmin-hackers] bugfix: Encoding of config files
>>
>>
>>NB, when reading AND writing!
>>And the wxUtfFile class will behave differently when creating 
>>a file or 
>>rewriting (will preserve encoding in the latter case)
> 
> 
> Err, ok. Well, how does the attached look o'Guru of encoding and such
> things?

No need to detect encoding, file reading/writing committed.

This problem probably persisted before, but problematically the problem 
that when opening a file after a file was opened (just open a file, and 
then open a recent file) is still persistent as problem. Probably a 
not-so-clean destructor (line array?)

Regards,
Andreas

Re: bugfix: Encoding of config files

От:
Dave Page <dpage@vale-housing.co.uk>
Дата:



On 24/1/06 19:07, "Andreas Pflug"  wrote:


> No need to detect encoding, file reading/writing committed.
> 
> This problem probably persisted before, but problematically the problem
> that when opening a file after a file was opened (just open a file, and
> then open a recent file) is still persistent as problem. Probably a
> not-so-clean destructor (line array?)

Wow, that was a real purple monkey dishwasher moment!! :-)

Thanks for fixing.

/D

FAQ