From ad8b2a9d3621b704492e6985dd24f37db5d5c379 Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Mon, 31 Oct 2005 19:34:10 +0000 Subject: [PATCH] Fixing few bugs for LatinToLocal --- golded3/geline.cpp | 3 ++- golded3/gelmsg.cpp | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/golded3/geline.cpp b/golded3/geline.cpp index 2965844..daf0f15 100644 --- a/golded3/geline.cpp +++ b/golded3/geline.cpp @@ -1684,7 +1684,8 @@ void ScanKludges(GMsg* msg, int getvalue) { void Latin2Local(char *str) { - if (!CFG->latin2local) return; + if (!CFG->latin2local || !str) return; + for (size_t i = 0; str[i]; i++) { byte chr = str[i]; diff --git a/golded3/gelmsg.cpp b/golded3/gelmsg.cpp index 002e67e..58d3121 100644 --- a/golded3/gelmsg.cpp +++ b/golded3/gelmsg.cpp @@ -108,15 +108,20 @@ int Area::LoadMsg(GMsg* msg, uint32_t msgno, int margin, int mode) { return true; } + msg->TextToLines(margin); + if (!mode && !AA->attr().hex()) { Latin2Local(msg->by); Latin2Local(msg->to); - Latin2Local(msg->re); - Latin2Local(msg->txt); + + if (!msg->attr.frq() && !msg->attr.att() && !msg->attr.urq()) + Latin2Local(msg->re); + + for (Line *ln = msg->lin; ln; ln = ln->next) + Latin2Local(ln->txt.begin()); } - msg->TextToLines(margin); return true; } return false;