Re: My humble tribute to psql -- usql v0.5.0

From: Kenneth Shaw <kenshaw(at)gmail(dot)com>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: My humble tribute to psql -- usql v0.5.0
Date: 2017-04-03 21:42:15
Message-ID: CAAyX=LEn0BVQ_7=awaY2hPzZcLiyeOQgsUvFN3CLbMO7BOa_iw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

UTF-8 works just fine with MS SQL:

ms:booktest(at)192(dot)168(dot)1(dot)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(at)gmail(dot)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(dot)Hilbert(at)gmx(dot)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(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2017-04-03 22:02:49 Re: My humble tribute to psql -- usql v0.5.0
Previous Message Kenneth Shaw 2017-04-03 21:20:49 Re: My humble tribute to psql -- usql v0.5.0