Skip to content

Commit

Permalink
Fix bug in can_encode_puz.
Browse files Browse the repository at this point in the history
As pointed out in #156, this returns false incorrectly for the Unicode
characters which are in the 128-160 range of the Cp1252 charset. This
means that XWord will unnecessarily use the less-supported 2.0 version
when saving .puz files if one of these characters are used.
  • Loading branch information
jpd236 committed Aug 16, 2021
1 parent a042c9a commit d58a0f3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions puz/puzstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@ static char unicode_to_puz(unsigned int cp)

static bool can_encode_puz(unsigned int cp)
{
if (cp > 255)
return false;
else if (cp < 128 || cp >= 160)
if (cp < 128 || (cp >= 160 && cp <= 255))
return true;
else
{
Expand Down

0 comments on commit d58a0f3

Please sign in to comment.