diff --git a/cfgs/config/advanced.cfg b/cfgs/config/advanced.cfg
index 43651c6..da9148e 100644
--- a/cfgs/config/advanced.cfg
+++ b/cfgs/config/advanced.cfg
@@ -1424,7 +1424,7 @@ XLATEXPORT IBMPC
XLATLOCALSET IBMPC
// Used to translate latin A-Za-z to local charset if one of neighbours
-// is from local charset too.
+// is from local charset too. Will work only for search.
// ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
;LatinToLocal ABCDEFGНIJKLMNOPQRSTUVWXYZabcdefghijklmnoрqrstuvwxуz ;cp866 - H,p,y
diff --git a/cfgs/config/advanced.rus b/cfgs/config/advanced.rus
index 7cf0e85..a03be10 100644
--- a/cfgs/config/advanced.rus
+++ b/cfgs/config/advanced.rus
@@ -1671,7 +1671,7 @@ XlatCharSet CP850 ASCII 850_ASC.chs
// Этот кейворд позволяет делать обратную замену латинских букв на русские.
// Замена будет делаться только тех латинских букв, что имеют по соседству
-// буквы локальной кодировки.
+// буквы локальной кодировки. Работает только для поиска.
// ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
;LatinToLocal ABCDEFGНIJKLMNOPQRSTUVWXYZabcdefghijklmnoрqrstuvwxуz ;cp866 - H,p,y
diff --git a/docs/notework.txt b/docs/notework.txt
index b4eb6e3..9ccc87f 100644
--- a/docs/notework.txt
+++ b/docs/notework.txt
@@ -19,7 +19,7 @@ ______________________________________________________________________
+ New config file token LatinToLocal.
Used to translate latin A-Za-z to local charset if one of neighbours
- is from local charset too.
+ is from local charset too. Will work only for search.
+ New config file token AreaRecycleBin . GoldEd will move deleted
messages to , if this token is defined.
diff --git a/golded3/gefind.cpp b/golded3/gefind.cpp
index 280a561..d1f7065 100644
--- a/golded3/gefind.cpp
+++ b/golded3/gefind.cpp
@@ -27,6 +27,10 @@
#include
#include
+#if defined(__USE_ALLOCA__)
+#include
+#endif
+
// ------------------------------------------------------------------
@@ -117,7 +121,28 @@ bool FindString(GMsg* msg, const char* prompt, int what) {
w_progress(MODE_UPDATE, C_INFOW, AA->lastread(), AA->Msgn.Count(), LNG->AdvancedSearch);
bool success = false;
- if(AA->LoadMsg(msg, AA->Msgn.CvtReln(AA->lastread()), margin)) {
+ if(AA->LoadMsg(msg, AA->Msgn.CvtReln(AA->lastread()), margin))
+ {
+ if (CFG->latin2local)
+ {
+ Latin2Local(msg->by);
+ Latin2Local(msg->to);
+
+ if (!msg->attr.frq() && !msg->attr.att() && !msg->attr.urq())
+ Latin2Local(msg->re);
+
+ for (Line *ln = msg->lin; ln; ln = ln->next)
+ {
+#if defined(__USE_ALLOCA__)
+ char *temp = (char *)alloca(ln->txt.length()+1);
+#else
+ __extension__ char temp[ln->txt.length()+1];
+#endif
+ strcpy(temp, ln->txt.c_str());
+ Latin2Local(temp);
+ ln->txt = temp;
+ }
+ }
// If hit, search again current mail without shortcircuit evaluation
success = srchmgr.search(msg, false, true);
diff --git a/golded3/gelmsg.cpp b/golded3/gelmsg.cpp
index bb9886b..c3b52c9 100644
--- a/golded3/gelmsg.cpp
+++ b/golded3/gelmsg.cpp
@@ -110,25 +110,6 @@ int Area::LoadMsg(GMsg* msg, uint32_t msgno, int margin, int mode) {
msg->TextToLines(margin);
- if (!mode && !AA->attr().hex())
- {
- Latin2Local(msg->by);
- Latin2Local(msg->to);
-
- if (!msg->attr.frq() && !msg->attr.att() && !msg->attr.urq())
- Latin2Local(msg->re);
-
- for (Line *ln = msg->lin; ln; ln = ln->next)
-#ifdef _MSC_VER
- Latin2Local(ln->txt.begin());
-#else
- { char*str=strdup(ln->txt.data());
- Latin2Local(str);
- ln->txt.assign(str);
- }
-#endif
- }
-
return true;
}
return false;