Re: [GENERAL] Re: [GENERAL] Re: [GENERAL] Different encoding for string values and identifier strings? Or (select 'tést' as tést) returns different values for string and identifier...

From: "Francisco Figueiredo Jr(dot)" <francisco(at)npgsql(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Re: [GENERAL] Re: [GENERAL] Different encoding for string values and identifier strings? Or (select 'tést' as tést) returns different values for string and identifier...
Date: 2011-03-18 13:44:15
Message-ID: AANLkTi=z07A=hspptvtw0tEhPG5a_OZVHwh0nqLHM8f_@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Oh, sorry for that.

My client code is Npgsql. I pulled those bytes from a debugging session
directly from the network stream. I wanted to know what bytes npgsql was
receiving.

This is the method which reads the data:

public static String ReadString(Stream network_stream)
{
NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "ReadString");

List<byte> buffer = new List<byte>();
for (int bRead = network_stream.ReadByte(); bRead != 0; bRead =
network_stream.ReadByte())
{
if (bRead == -1)
{
throw new IOException();
}
else
{
buffer.Add((byte) bRead);
}
}

if (NpgsqlEventLog.Level >= LogLevel.Debug)
NpgsqlEventLog.LogMsg(resman, "Log_StringRead",
LogLevel.Debug, ENCODING_UTF8.GetString(buffer.ToArray()));

return ENCODING_UTF8.GetString(buffer.ToArray());
}

My database has encoding set to UTF-8 although my lc_collate is pt.BR.UTF-8
this lc setting my have cause some trouble?

I also have problems with psql client where the char doesn't appear at all.
Andreas could see the char though...

I hope it helps.

Thanks in advance.
--
Sent from my Android phone

Francisco Figueiredo Jr.
Npgsql lead developer
fxjr.blogspot.com
twitter.com/franciscojunior
Em 18/03/2011 01:29, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> escreveu:

Responses

Browse pgsql-general by date

  From Date Subject
Next Message jonathansfl 2011-03-18 14:59:01 TO_CHAR(timestamptz,datetimeformat) wrong after DST change
Previous Message Voils, Steven M 2011-03-18 12:38:30 Re: Primary key vs unique index