Re: [PATCHES] Solve a problem of LC_TIME of windows.

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: "Jaime Casanova" <jcasanov(at)systemguards(dot)com(dot)ec>
Cc: "Hiroshi Saito" <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Solve a problem of LC_TIME of windows.
Date: 2008-11-11 06:48:44
Message-ID: 20081111152112.B605.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


"Jaime Casanova" <jcasanov(at)systemguards(dot)com(dot)ec> wrote:

> i'm confused, original patch has this signature:
> + conv_strftime(char *src, size_t len, const char *format, const struct tm *tm)
> your's has:
> +strftime_win32(char *dst, size_t dstlen, const char *format, const

> you change all src for dst, just a variable name decision but a
> radical one... why was that (i honestly doesn't understand this patch
> very well ;)?

That's because the first argument is not an input buffer,
but an output buffer. MSDN also calls it 'strDest'.
http://msdn.microsoft.com/en-us/library/fe06s4ak(VS.71).aspx
Linux manpage calls it 's', but I think it means String, not Src.
http://man.cx/strftime

If you can review the patch, please use the attached one instead.
I modified it in response to the discussion of pg_do_encoding_conversion.

BTW, I cannot understand the comment in the function head,

+ * result is obtained by locale setup of LC_TIME in the environment
+ * of windows at present CP_ACP. Therefore, conversion is needed
+ * for SERVER_ENCODING. SJIS which is not especially made to server
+ * encoding in Japan returns.

but it probably says:

----
strftime in Windows returns in CP_ACP encoding, but it could be
different from SERVER_ENCODING. Especially, Windows Japanese edition
requires conversions because it uses SJIS as CP_ACP, but we don't
support SJIS as a server encoding.
----

I hope you would review my English not only C ;-)

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

Attachment Content-Type Size
strftime_win32-1111.patch application/octet-stream 1.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alex Hunsaker 2008-11-11 06:51:44 Re: SSL cleanups/hostname verification
Previous Message Jaime Casanova 2008-11-11 06:12:29 Re: [PATCHES] Solve a problem of LC_TIME of windows.

Browse pgsql-patches by date

  From Date Subject
Next Message Hiroshi Saito 2008-11-11 14:10:29 Re: [PATCHES] Solve a problem of LC_TIME of windows.
Previous Message Jaime Casanova 2008-11-11 06:12:29 Re: [PATCHES] Solve a problem of LC_TIME of windows.