Re: Does mbutils.c really need to use L'\0' ?

From: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Does mbutils.c really need to use L'\0' ?
Date: 2010-07-07 03:35:44
Message-ID: 20100707123544.97EF.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> >> I'm dubious that it's worth the trouble. I suggest that it might be
> >> best to replace these usages of L'\0' by plain scalar 0.
> I'd tend to go with just 0,
> which is a reasonably common substitute for non-wide '\0' ...

I think all of the following codes work in the same way
at least on Windows, where the codes are actually used.

utf16[dstlen] = L'\0';
utf16[dstlen] = '\0';
utf16[dstlen] = 0;
utf16[dstlen] = (WCHAR) 0;

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rajanikant Chirmade 2010-07-07 04:35:29 multibyte-character aware support for function "downcase_truncate_identifier()"
Previous Message Alvaro Herrera 2010-07-07 02:59:00 Re: Bug? Concurrent COMMENT ON and DROP object