public inbox for [email protected]  
help / color / mirror / Atom feed
From: Sergey Burladyan <[email protected]>
To: Neel Patel <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Cc: Ashesh Vashi <[email protected]>
Cc: Dave Page <[email protected]>
Subject: Re: pgagent unicode support
Date: Wed, 24 Feb 2021 14:23:39 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CACCA4P1NgUGZO8PSC6_Js+__pqALrSkd-NGCGWr_OtYptGoqEA@mail.gmail.com>
References: <[email protected]>
	<CA+OCxoxsk-VJOJvw95V+pDN0G79T5-F1jAHB-THsPZd10f0KRg@mail.gmail.com>
	<CACCA4P0PG8y_u9vDwTTL4AHbXOfP1k7joLY4tjLQ40DNpWgyoA@mail.gmail.com>
	<CACCA4P3JvfMmG_LCm8Oeqnp4r=EuJBLuaS2mUieuw+--2ybgFQ@mail.gmail.com>
	<CACCA4P1NgUGZO8PSC6_Js+__pqALrSkd-NGCGWr_OtYptGoqEA@mail.gmail.com>

Neel Patel <[email protected]> writes:

> Do you have any comments for this updated patch ? Let us know ASAP so that
> we can commit it.

Sorry about the delay.

It looks better than my patch, thanks!

There is only two comments, about wcstombs_s and about setlocale.

About win32 wcstombs_s:
+        wcstombs_s(&charsConverted, mbs, mb_len + 10, wchar_str, mb_len + 1);

https://docs.microsoft.com/ru-ru/cpp/c-runtime-library/reference/wcstombs-s-wcstombs-s-l?view=msvc-1...
>> sizeInBytes
>> The size in bytes of the mbstr buffer.
>> count
>> The maximum number of bytes to store in the mbstr buffer, not including
>> the terminating null character

Maybe it should look something like this:
+        wcstombs_s(&charsConverted, mbs, mb_len + 1, wchar_str, mb_len);

About setlocale, I think you missed it in your patch:
diff --git a/unix.cpp b/unix.cpp
index 9a41e38..d4b0d3d 100644
--- a/unix.cpp
+++ b/unix.cpp
@@ -155,6 +155,8 @@ static void daemonize(void)
 
 int main(int argc, char **argv)
 {
+	setlocale(LC_ALL, "");
+
 	std::wstring executable;
 	executable.assign(CharToWString(argv[0]));

-- 
Sergey Burladyan





view thread (13+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: pgagent unicode support
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox