Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEsGj-0005TZ-K5 for pgadmin-hackers@arkaria.postgresql.org; Wed, 24 Feb 2021 11:23:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lEsGi-0006g1-5p for pgadmin-hackers@arkaria.postgresql.org; Wed, 24 Feb 2021 11:23:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEsGh-0006ft-UY for pgadmin-hackers@lists.postgresql.org; Wed, 24 Feb 2021 11:23:48 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lEsGc-0005sP-Vx for pgadmin-hackers@postgresql.org; Wed, 24 Feb 2021 11:23:46 +0000 Received: by mail-lj1-x22e.google.com with SMTP id c8so1927080ljd.12 for ; Wed, 24 Feb 2021 03:23:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=LEDw8zxAjmQo5L0y3wh7J2bTj3QnMSqu5rAq2IBpPPU=; b=MzWHK4UshWUF3/zQImj2sVhqMPc59ulyFcSBzvJwTdFGjdLryp5YeRneyc4ArkYmur 2amgkIOPTVSRw70Hz4xVqgxg6ZEA//lLaTrrfgLm4GEtSf9tnOhuEhFJ0TOtbiOJEhp2 sOaZMsyThULQcCVwblbS3+j9zrhrc241RyI1On+eTuphUr32qTMB5+6Tyti96NVglEE4 0q38FbLt/sZPrgVKLE8Vu45YVdUObJmPYeK14vllHiSeJDW5lYB7BEVL/Ct+t0yS5KMp v7anXfA7Esl8+vF4SihTTXLFTnVAED3jp7SvL6MCa2CoMN9gw/0trvSzNOME/KkaH6Nb aLgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=LEDw8zxAjmQo5L0y3wh7J2bTj3QnMSqu5rAq2IBpPPU=; b=QW3mEVj37U1190HCYkiPX3QDuZHdoAMLCMS2+F8seFK0Mb5KCjR1neQm2H3UgiF6Xm 6Zupv/yNvTIBYNqwv3o+i7OkjRb9UEs5czBjykj4dQd0MWmE7G0y6K4Gzml6orNq4f5d B+6JaqSlTGAu6T0PF43Px/XcNBZmEOwml5iSXdNUcHUBl62P/wjLi87STmOGNfdx61dw c5GKgcaSmIAnTvjIhVXTGnBakMey5dWiJgu+/kyoez95CdLZ2s3POEAaJiZGVxGDfvS5 dRWBaEmUdJsjRb4O/l1bobjOqhO6ZInD7eNYyUw/OdwvaJMuQ51u0K23cpAnwzAAsrh7 1q8g== X-Gm-Message-State: AOAM530RYh14HhsbuSIQdtSA8PB2n08yeFeuHY/o1HoPaoI+KJJUpk8l ah+0ocMa2QCFvTVmImHQMIo= X-Google-Smtp-Source: ABdhPJyPlpNOxzI7QT0EnFt+MlTCbD4ycWuzwtlscT5FebxxXX0AXhTUQ0NJeLG670jU7C6DJngPBA== X-Received: by 2002:a2e:8596:: with SMTP id b22mr1451108lji.482.1614165820947; Wed, 24 Feb 2021 03:23:40 -0800 (PST) Received: from seb ([77.232.147.173]) by smtp.gmail.com with ESMTPSA id r15sm430929lfn.70.2021.02.24.03.23.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 03:23:40 -0800 (PST) From: Sergey Burladyan To: Neel Patel Cc: pgadmin-hackers , Ashesh Vashi , Dave Page Subject: Re: pgagent unicode support References: <87a6shyenl.fsf@gmail.com> Date: Wed, 24 Feb 2021 14:23:39 +0300 In-Reply-To: (Neel Patel's message of "Tue, 23 Feb 2021 18:23:57 +0530") Message-ID: <874ki1yais.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Neel Patel 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-160 >> 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