Re: My humble tribute to psql -- usql v0.5.0 - Mailing list pgsql-general

From Kenneth Shaw
Subject Re: My humble tribute to psql -- usql v0.5.0
Date
Msg-id CAAyX=LEn0BVQ_7=awaY2hPzZcLiyeOQgsUvFN3CLbMO7BOa_iw@mail.gmail.com
Whole thread Raw
In response to Re: My humble tribute to psql -- usql v0.5.0  (Kenneth Shaw <kenshaw@gmail.com>)
List pgsql-general
UTF-8 works just fine with MS SQL:

ms:booktest@192.168.1.5=> select N'这是一个';
    col0
+----------+
  这是一个
(1 rows)

You need to use a "unicode" string, as indicated here using N''. You
might be able to change the default behavior in SQL Server to treat
strings as unicode strings, by changing the default collation settings
(which is latin1 or windows' 1252 encoding or whatever it is). If
you're working with a table, when columns are N* column types, it will
work fine.


-Ken


On Tue, Apr 4, 2017 at 4:20 AM, Kenneth Shaw <kenshaw@gmail.com> wrote:
> This doesn't seem to be a problem with PostgreSQL, MySQL, Oracle, or
> SQLite3 databases. It was a problem with MSSQL in the limited check
> that I just did. I don't see any driver option for the MSSQL Go
> driver. I'll poke around and see if there's a "client encoding"
> option.
>
> -Ken
>
>
> On Tue, Apr 4, 2017 at 4:08 AM, Karsten Hilbert <Karsten.Hilbert@gmx.net> wrote:
>> On Tue, Apr 04, 2017 at 03:48:16AM +0700, Kenneth Shaw wrote:
>>
>>> It should work. What database did you try that with? I haven't tried
>>> to do heavy / extensive utf8 tests, but all of Go (including the
>>> "readline" package that is used for capturing input are native utf8.
>>> The problem is potentially a connect option in the DSN for the
>>> database needs to be manually added
>>
>> Do you "SET client_encoding" ?
>>
>> Karsten
>> --
>> GPG key ID E4071346 @ eu.pool.sks-keyservers.net
>> E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346
>>
>>
>> --
>> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general


pgsql-general by date:

Previous
From: Kenneth Shaw
Date:
Subject: Re: My humble tribute to psql -- usql v0.5.0
Next
From: Merlin Moncure
Date:
Subject: Re: My humble tribute to psql -- usql v0.5.0