Commit cd3e0071 authored by Tom Lane's avatar Tom Lane

Allow unrecognized encoding names in locales, as long as they're the same.

The buildfarm says commit 58274728 doesn't
work so well on Windows.  This is because the encoding part of Windows
locale names can be just a code page number, eg "1252", which we don't
consider to be a valid encoding name.  Add a check to accept encoding
parts that are case-insensitively string equal; this at least ensures
that the new code doesn't reject any cases that the old code allowed.
parent db98b313
......@@ -437,8 +437,14 @@ equivalent_locale(const char *loca, const char *locb)
if (!chara || !charb)
return (pg_strcasecmp(loca, locb) == 0);
/* Compare the encoding parts. */
if (!equivalent_encoding(chara + 1, charb + 1))
/*
* Compare the encoding parts. Windows tends to use code page numbers for
* the encoding part, which equivalent_encoding() won't like, so accept if
* the strings are case-insensitive equal; otherwise use
* equivalent_encoding() to compare.
*/
if (pg_strcasecmp(chara + 1, charb + 1) != 0 &&
!equivalent_encoding(chara + 1, charb + 1))
return false;
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment