View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001773 | Far Manager | Popup Menu | public | 2011-05-18 20:07 | 2012-05-17 10:20 |
| Reporter | 2useven10 | Assigned To | vskirdin | ||
| Priority | normal | Severity | feature | Reproducibility | N/A |
| Status | closed | Resolution | fixed | ||
| Product Version | 3.0 | ||||
| Fixed in Version | 3.0 | ||||
| Summary | 0001773: Дадим возможность разрешать пункт AutoDetect в меню по Shift-F8 | ||||
| Description | просто добавлен параметр, чтобы это можно было использовать. Не уверен, что категорию выбрал правильно. | ||||
| Additional Information | Изменения для вьювера - часть 2. | ||||
| Tags | No tags attached. | ||||
| Build | 2613 | ||||
|
|
Viewer-Codepage.diff (2,232 bytes)
Index: codepage.cpp
===================================================================
--- codepage.cpp (revision 6222)
+++ codepage.cpp (working copy)
@@ -527,7 +527,7 @@
}
// �������� ��� ����� ����� ��������
-void FillCodePagesVMenu(bool bShowUnicode, bool bShowUTF, bool bShowUTF7)
+void FillCodePagesVMenu(bool bShowUnicode, bool bShowUTF, bool bShowUTF7, bool bShowAutoDetect=false)
{
UINT codePage = currentCodePage;
@@ -545,7 +545,12 @@
// �������� ����� ��������
// BUBUG: ����� �������� ��������� UTF7 �������� bShowUTF7 ����� ����� �������
- AddCodePages(::OEM | ::ANSI | (bShowUTF ? ::UTF8 : 0) | (bShowUTF7 ? ::UTF7 : 0) | (bShowUnicode ? (::UTF16BE | ::UTF16LE) : 0));
+ AddCodePages(::OEM | ::ANSI
+ | (bShowUTF ? ::UTF8 : 0)
+ | (bShowUTF7 ? ::UTF7 : 0)
+ | (bShowUnicode ? (::UTF16BE | ::UTF16LE) : 0)
+ | (bShowAutoDetect ? ::Auto : 0)
+ );
// ��������������� ��������� ������ ��������
currentCodePage = codePage;
// ������������ ���
@@ -685,7 +690,7 @@
Dlg.Process();
}
-UINT SelectCodePage(UINT nCurrent, bool bShowUnicode, bool bShowUTF, bool bShowUTF7)
+UINT SelectCodePage(UINT nCurrent, bool bShowUnicode, bool bShowUTF, bool bShowUTF7, bool bShowAutoDetect)
{
CallbackCallSource = CodePageSelect;
currentCodePage = nCurrent;
@@ -695,7 +700,7 @@
CodePages->SetFlags(VMENU_WRAPMODE|VMENU_AUTOHIGHLIGHT);
CodePages->SetHelp(L"CodePagesMenu");
// �������� ����� ��������
- FillCodePagesVMenu(bShowUnicode, bShowUTF, bShowUTF7);
+ FillCodePagesVMenu(bShowUnicode, bShowUTF, bShowUTF7, bShowAutoDetect);
// ��������� ���
CodePages->Show();
Index: codepage.hpp
===================================================================
--- codepage.hpp (revision 6222)
+++ codepage.hpp (working copy)
@@ -56,7 +56,7 @@
bool IsCodePageSupported(UINT CodePage);
-UINT SelectCodePage(UINT nCurrent, bool bShowUnicode, bool bShowUTF, bool bShowUTF7 = false);
+UINT SelectCodePage(UINT nCurrent, bool bShowUnicode, bool bShowUTF, bool bShowUTF7 = false, bool bShowAutoDetect=false);
UINT FillCodePagesList(HANDLE dialogHandle, UINT controlId, UINT codePage, bool allowAuto, bool allowAll);
|
|
|
Viewer-Codepage-2.diff (2,571 bytes)
Index: codepage.cpp
===================================================================
--- codepage.cpp (revision 6222)
+++ codepage.cpp (working copy)
@@ -527,7 +527,7 @@
}
// �������� ��� ����� ����� ��������
-void FillCodePagesVMenu(bool bShowUnicode, bool bShowUTF, bool bShowUTF7)
+void FillCodePagesVMenu(bool bShowUnicode, bool bShowUTF, bool bShowUTF7, bool bShowAutoDetect=false)
{
UINT codePage = currentCodePage;
@@ -545,7 +545,12 @@
// �������� ����� ��������
// BUBUG: ����� �������� ��������� UTF7 �������� bShowUTF7 ����� ����� �������
- AddCodePages(::OEM | ::ANSI | (bShowUTF ? ::UTF8 : 0) | (bShowUTF7 ? ::UTF7 : 0) | (bShowUnicode ? (::UTF16BE | ::UTF16LE) : 0));
+ AddCodePages(::OEM | ::ANSI
+ | (bShowUTF ? ::UTF8 : 0)
+ | (bShowUTF7 ? ::UTF7 : 0)
+ | (bShowUnicode ? (::UTF16BE | ::UTF16LE) : 0)
+ | (bShowAutoDetect ? ::Auto : 0)
+ );
// ��������������� ��������� ������ ��������
currentCodePage = codePage;
// ������������ ���
@@ -685,7 +690,7 @@
Dlg.Process();
}
-UINT SelectCodePage(UINT nCurrent, bool bShowUnicode, bool bShowUTF, bool bShowUTF7)
+UINT SelectCodePage(UINT nCurrent, bool bShowUnicode, bool bShowUTF, bool bShowUTF7, bool bShowAutoDetect)
{
CallbackCallSource = CodePageSelect;
currentCodePage = nCurrent;
@@ -695,7 +700,7 @@
CodePages->SetFlags(VMENU_WRAPMODE|VMENU_AUTOHIGHLIGHT);
CodePages->SetHelp(L"CodePagesMenu");
// �������� ����� ��������
- FillCodePagesVMenu(bShowUnicode, bShowUTF, bShowUTF7);
+ FillCodePagesVMenu(bShowUnicode, bShowUTF, bShowUTF7, bShowAutoDetect);
// ��������� ���
CodePages->Show();
@@ -731,7 +736,7 @@
}
// ������� ������� ������ ��������
- UINT codePage = CodePages->Modal::GetExitCode() >= 0 ? GetMenuItemCodePage() : (UINT)-1;
+ UINT codePage = CodePages->Modal::GetExitCode() >= 0 ? static_cast<WORD>(GetMenuItemCodePage()) : (UINT)-1;
delete CodePages;
CodePages = nullptr;
return codePage;
Index: codepage.hpp
===================================================================
--- codepage.hpp (revision 6222)
+++ codepage.hpp (working copy)
@@ -56,7 +56,7 @@
bool IsCodePageSupported(UINT CodePage);
-UINT SelectCodePage(UINT nCurrent, bool bShowUnicode, bool bShowUTF, bool bShowUTF7 = false);
+UINT SelectCodePage(UINT nCurrent, bool bShowUnicode, bool bShowUTF, bool bShowUTF7 = false, bool bShowAutoDetect=false);
UINT FillCodePagesList(HANDLE dialogHandle, UINT controlId, UINT codePage, bool allowAuto, bool allowAll);
|
|
|
небольшое добавление без которого нельзя отличить выбранный автодетект от Cancel (CP_AUTODETECT = -1 -- не очень удачный выбор...) |
|
|
1. почему пункт все время залочен? 2. неплохо бы и для Far*.hlf.m4 патчи делать. |
|
|
1. Эти изменения как раз и поэволят из вьювера (редактора...) разлочить этот пункт меню (вьверного кода который это будет использовать в этом патче нет). ЗЫ: я не добавлял этот пункт меню - он там уже давно есть (на будущее - оно наступило :) 2. Править справку, пока изменения не приняты - не рано? |
|
|
1. я приложил твой патч и проверил, после чего о залочке и написал. хмм... смотрю viewer.cpp, там UINT nCodePage = SelectCodePage(VM.CodePage, true, true); а где последний true? аналогично и в fileedit.cpp так что получается недоделка (или обзови этот патч промежуточным ;-)) 2. я имел ввиду, что если что-то меняется для пользователя, то в патч добавлять так же исправления и для хелпов. |
|
|
именно промежуточный, я об этом уже писал. могу добавить соответствующий код из вьювера (у меня там изменений очень много и вытаскивать кусочки непросто). добавить false, true [3-й параметр UTF7 - а оно надо?] в fileedit.cpp недостаточно, надо ещё и вызов автодетекта добавлять. |
|
|
Viewer-Codepage3.diff (3,420 bytes)
Index: codepage.cpp
===================================================================
--- codepage.cpp (revision 6222)
+++ codepage.cpp (working copy)
@@ -527,7 +527,7 @@
}
// �������� ��� ����� ����� ��������
-void FillCodePagesVMenu(bool bShowUnicode, bool bShowUTF, bool bShowUTF7)
+void FillCodePagesVMenu(bool bShowUnicode, bool bShowUTF, bool bShowUTF7, bool bShowAutoDetect=false)
{
UINT codePage = currentCodePage;
@@ -545,7 +545,12 @@
// �������� ����� ��������
// BUBUG: ����� �������� ��������� UTF7 �������� bShowUTF7 ����� ����� �������
- AddCodePages(::OEM | ::ANSI | (bShowUTF ? ::UTF8 : 0) | (bShowUTF7 ? ::UTF7 : 0) | (bShowUnicode ? (::UTF16BE | ::UTF16LE) : 0));
+ AddCodePages(::OEM | ::ANSI
+ | (bShowUTF ? ::UTF8 : 0)
+ | (bShowUTF7 ? ::UTF7 : 0)
+ | (bShowUnicode ? (::UTF16BE | ::UTF16LE) : 0)
+ | (bShowAutoDetect ? ::Auto : 0)
+ );
// ��������������� ��������� ������ ��������
currentCodePage = codePage;
// ������������ ���
@@ -685,7 +690,7 @@
Dlg.Process();
}
-UINT SelectCodePage(UINT nCurrent, bool bShowUnicode, bool bShowUTF, bool bShowUTF7)
+UINT SelectCodePage(UINT nCurrent, bool bShowUnicode, bool bShowUTF, bool bShowUTF7, bool bShowAutoDetect)
{
CallbackCallSource = CodePageSelect;
currentCodePage = nCurrent;
@@ -695,7 +700,7 @@
CodePages->SetFlags(VMENU_WRAPMODE|VMENU_AUTOHIGHLIGHT);
CodePages->SetHelp(L"CodePagesMenu");
// �������� ����� ��������
- FillCodePagesVMenu(bShowUnicode, bShowUTF, bShowUTF7);
+ FillCodePagesVMenu(bShowUnicode, bShowUTF, bShowUTF7, bShowAutoDetect);
// ��������� ���
CodePages->Show();
@@ -731,7 +736,7 @@
}
// ������� ������� ������ ��������
- UINT codePage = CodePages->Modal::GetExitCode() >= 0 ? GetMenuItemCodePage() : (UINT)-1;
+ UINT codePage = CodePages->Modal::GetExitCode() >= 0 ? static_cast<WORD>(GetMenuItemCodePage()) : (UINT)-1;
delete CodePages;
CodePages = nullptr;
return codePage;
Index: viewer.cpp
===================================================================
--- viewer.cpp (revision 6222)
+++ viewer.cpp (working copy)
@@ -1304,10 +1304,18 @@
case KEY_SHIFTF8:
{
LastPage = 0;
- UINT nCodePage = SelectCodePage(VM.CodePage, true, true);
+ UINT nCodePage = SelectCodePage(VM.CodePage, true, true, false, true);
if (nCodePage!=(UINT)-1)
{
+ if (nCodePage == (WORD)(CP_AUTODETECT & 0xffff))
+ {
+ __int64 fpos = vtell();
+ bool detect = GetFileFormat(ViewFile,nCodePage,&Signature,true) && IsCodePageSupported(nCodePage);
+ vseek(fpos, SEEK_SET);
+ if (!detect)
+ nCodePage = Opt.ViOpt.AnsiCodePageAsDefault ? GetACP() : GetOEMCP();
+ }
CodePageChangedByUser=TRUE;
if (IsUnicodeCodePage(VM.CodePage) && !IsUnicodeCodePage(nCodePage))
Index: codepage.hpp
===================================================================
--- codepage.hpp (revision 6222)
+++ codepage.hpp (working copy)
@@ -56,7 +56,7 @@
bool IsCodePageSupported(UINT CodePage);
-UINT SelectCodePage(UINT nCurrent, bool bShowUnicode, bool bShowUTF, bool bShowUTF7 = false);
+UINT SelectCodePage(UINT nCurrent, bool bShowUnicode, bool bShowUTF, bool bShowUTF7 = false, bool bShowAutoDetect=false);
UINT FillCodePagesList(HANDLE dialogHandle, UINT controlId, UINT codePage, bool allowAuto, bool allowAll);
|
|
|
последний diff - полный комплект (без редактора, только вьювер) |
|
|
build 2034 |
|
|
А сюда глянете http://forum.farmanager.com/viewtopic.php?f=6&t=4810? Вкратце: Нужна возможность автоматического определения кодировки файла по запросу ...Хотелось бы иметь возможность вручную вызвать авто(пере)определение кодировки ... из диалога открытия файла Shift-F4 ...Для ShiftF4, думаю, можно сделать 2 спецпункта - "автоопределение" (анализ сигнатур + эвристика) и "предыдущая/по умолчанию" (из истории/настроек). |
|
|
EditorCodepage.diff (1,074 bytes)
Index: fileedit.cpp
===================================================================
--- fileedit.cpp (revision 6226)
+++ fileedit.cpp (working copy)
@@ -1299,9 +1299,23 @@
{
if (!IsUnicodeCodePage(m_codepage))
{
- int codepage = SelectCodePage(m_codepage, false, true);
+ UINT codepage = SelectCodePage(m_codepage, false, true, false, true);
+ if ( codepage == (CP_AUTODETECT & 0xffff) )
+ {
+ File edit_file;
+ bool detect = false, sig_found = false;
- if (codepage != -1)
+ if (edit_file.Open(strFileName, FILE_READ_DATA, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, nullptr, OPEN_EXISTING))
+ {
+ detect = GetFileFormat(edit_file,codepage,&sig_found,true) && IsCodePageSupported(codepage);
+ edit_file.Close();
+ }
+
+ if (!detect)
+ codepage = Opt.EdOpt.AnsiCodePageAsDefault ? GetACP() : GetOEMCP();
+ }
+
+ if (codepage != static_cast<UINT>(-1))
{
SetCodePage(codepage);
Flags.Set(FFILEEDIT_CODEPAGECHANGEDBYUSER);
|
|
|
добавил AutoDetect На Shift-F8 редактора. по аналогии с вьювером, про редактор знаю мало - проверяйте. |
|
|
Ну вот опять. :-( Почему в один Инц нужно запихивать ФСЕ? Здесь конкретная задача. Ее решили. Если нужно больше - Wелкам, новая запись на мантисе ждет. Или проще завести два инца "Ошибки в ФАРе" и "Виши в ФАРе" и потом совсем запутаться в той портянке, что получится. Так? |
|
|
моя запись вроде бы в тему, или это предыдущему оратору? ps: похоже я поменял статус и не заметил как... |
|
|
2useven10, это не тебе. Патч к редактору ожидаем в рамках этого Инца. Статус я потом выставлю по новой. |
|
|
build 2036 |
|
|
>Ну вот опять. :-( >Почему в один Инц нужно запихивать ФСЕ? "Запихивать" ничего не нужно, я только лишь обращаю внимание на связанное обсуждение форума. P.S. Вот и тикет: 0001775 |
|
|
Баг. Сохраняем любой файл (например FarRus.hlf) в кодировке 1200, и открываем его же в 866. Выполняем Automatic detection. В результате первая строка почему-то становится пустой, и больше никаких видимых изменений не происходит !!! Хотя в статусе видно что кодировка определилась (1200), и если выйти/войти, то файл откроется правильно. НО: если есть несохранённые изменения, то фар предложит сохранить файл, и в этом случае 1)придётся побороться с последствиями двойного перекодирования 2)первая строка потеряется необратимо P.S. http://bugs.farmanager.com/view.php?id=868#c7012 |
|
|
Это скорее фича, а не баг. Редактор делает перекодировку загруженного в память текста, который уже в юникоде в юникод. То что вы хотите сделать делается через релоад (и работает). Правильно пожалуй будет сделать игнор при автодетекте юникодной кодировки. |
|
|
Зачем же игнор? Почему не предложить пользователю релоад? >Это скорее фича, а не баг. Куда же девается первая строка? |
|
|
>...который уже в юникоде в юникод Никак не могу согласиться. Как ни крути, а кодировка по сути не более чем проекция данных на редактор, и смена проекции не должна влиять на сами данные. А у нас почему-то просходит радикальное изменение данных, приводящее к двойной перекодировке. Очевидно, имеет место какая-то фундаментальная ошибка. |
|
|
Я уже писал - про редактор знаю мало. Но в данном случае дело обстоит примерно так: 1) 'проекция' уже построена и именно её редактор пытается конвертить (через двойное перекодирование WideCharToMultibyte / MultibyteToWideChar). 2) в проекции все строки кроме первой начинаются с L'\0', поэтому для конвертера они пустые и посему не конвертятся = не портятся. Почему так, можно ли за реальное время лучше.... - не знаю. |
|
|
> 'проекция' уже построена и именно её редактор пытается конвертить (через двойное перекодирование WideCharToMultibyte / MultibyteToWideChar) именно, поэтому такое "перекодирование" надо запрещать. |
|
|
На самом деле, если добавить немного интеллекта в Edit::SetCodePage() и не делать MultiByteToWideChar() для cp=1200/1201, а ручками сгруппировать/перевернуть пары байтов - вполне может заработать даже такое "перекодирование". Да и проверку *Str != 0 выкинуть. Хотя нет вру, не всё так просто - есть ещё '\0' переползающий на другую строку и паразитные пустые строки из-за того же '\0'... |
|
|
IgnoreIncompatibleAutodetect.diff (827 bytes)
Index: fileedit.cpp
===================================================================
--- fileedit.cpp (revision 6272)
+++ fileedit.cpp (working copy)
@@ -1312,12 +1312,11 @@
if (edit_file.Open(strFileName, FILE_READ_DATA, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, nullptr, OPEN_EXISTING))
{
- detect = GetFileFormat(edit_file,codepage,&sig_found,true) && IsCodePageSupported(codepage);
+ detect = GetFileFormat(edit_file,codepage,&sig_found,true);
edit_file.Close();
}
-
- if (!detect)
- codepage = Opt.EdOpt.AnsiCodePageAsDefault ? GetACP() : GetOEMCP();
+ if ( !detect || IsUnicodeCodePage(codepage) || !IsCodePageSupported(codepage) )
+ codepage = static_cast<UINT>(-1);
}
if (codepage != static_cast<UINT>(-1))
|
|
|
Тихий игнор + при неуспехе не подставлять умолчательную кодировку |
|
|
> 2) в проекции все строки кроме первой начинаются с L'\0', > поэтому для конвертера они пустые и посему не конвертятся = не портятся. Первая строка пропадает = портится > 'проекция' уже построена Фар не может построить новую? Переоткрыть файл? >именно, поэтому такое "перекодирование" надо запрещать. Запретить-то легко. И пойдут репорты мол не работает ваш автодетект. Хочется как-то по-умнее. В любом случае, надо как минимум сообщать пользователю что продетектирована такая-то страница. |
|
|
JohnDoe > Фар не может построить новую? Переоткрыть файл? может при релоаде > Хочется как-то по-умнее. чуть позже выложу более болтливый вариант. если все режимвы проверите - будет здорово. и кстати, хэлп на Autodetect и всю эту тягомотину (если возьмут) за Вами. |
|
|
Ругаемся на все проблемы с перекодировкой в редакторе. В том числе ДО перекодировки, если будут потери (можно отменить). Текст сообщений надо вычитывать. Потом (желающие сейчас) можно добавить вызов диалога релоада с подготовленными параметрами сразу из меню подтверждения/отмены проблемной перекодировки. А можно просто вызов релоада для текущего файла повесить на отдельную кнопку. Думаю макро-монстры (вроде JohnDoe :) сделают это за минуту - я не умею... |
|
|
VerboseCodepageChange.diff (12,540 bytes)
Index: edit.cpp
===================================================================
--- edit.cpp (revision 6272)
+++ edit.cpp (working copy)
@@ -135,74 +135,71 @@
xf_free(Str);
}
-DWORD Edit::SetCodePage(UINT codepage)
+DWORD Edit::SetCodePage( UINT codepage, bool check_only, char * &decoded, int &bsize )
{
- DWORD Ret=SETCP_NOERROR;
+ DWORD Ret = SETCP_NOERROR;
+ if (codepage == m_codepage)
+ return Ret;
+
DWORD wc2mbFlags=WC_NO_BEST_FIT_CHARS;
BOOL UsedDefaultChar=FALSE;
LPBOOL lpUsedDefaultChar=&UsedDefaultChar;
-
if (m_codepage==CP_UTF7 || m_codepage==CP_UTF8) // BUGBUG: CP_SYMBOL, 50xxx, 57xxx too
{
wc2mbFlags=0;
lpUsedDefaultChar=nullptr;
}
+ DWORD mb2wcFlags = (codepage == CP_UTF7 ? 0 : MB_ERR_INVALID_CHARS); // BUGBUG: CP_SYMBOL, 50xxx, 57xxx too
- DWORD mb2wcFlags=MB_ERR_INVALID_CHARS;
-
- if (codepage==CP_UTF7) // BUGBUG: CP_SYMBOL, 50xxx, 57xxx too
+ if ( Str )
{
- mb2wcFlags=0;
- }
-
- if (codepage != m_codepage)
- {
- if (Str && *Str)
+ if ( 3*StrSize + 1 > bsize )
{
- //m_codepage = codepage;
- int length = WideCharToMultiByte(m_codepage, wc2mbFlags, Str, StrSize, nullptr, 0, nullptr, lpUsedDefaultChar);
-
- if (UsedDefaultChar)
- Ret|=SETCP_WC2MBERROR;
-
- char *decoded = (char*)xf_malloc(length);
-
- if (!decoded)
+ delete[] decoded;
+ decoded = new char[bsize = 256 + 4*StrSize];
+ if ( !decoded )
{
- Ret|=SETCP_OTHERERROR;
- return Ret;
+ bsize = 0;
+ return Ret | SETCP_OTHERERROR;
}
+ }
- WideCharToMultiByte(m_codepage, 0, Str, StrSize, decoded, length, nullptr, nullptr);
- int length2 = MultiByteToWideChar(codepage, mb2wcFlags, decoded, length, nullptr, 0);
+ int length = WideCharToMultiByte(m_codepage, 0, Str, StrSize, decoded, bsize, nullptr, lpUsedDefaultChar);
+ if (UsedDefaultChar)
+ {
+ Ret |= SETCP_WC2MBERROR;
+ if ( check_only )
+ return Ret;
+ }
- if (!length2 && GetLastError()==ERROR_NO_UNICODE_TRANSLATION)
- {
- Ret|=SETCP_MB2WCERROR;
+ int length2 = MultiByteToWideChar(codepage, mb2wcFlags, decoded, length, nullptr, 0);
+ if (!length2 && GetLastError() == ERROR_NO_UNICODE_TRANSLATION)
+ {
+ Ret |= SETCP_MB2WCERROR;
+ if ( !check_only )
length2 = MultiByteToWideChar(codepage, 0, decoded, length, nullptr, 0);
- }
+ }
+ if ( check_only )
+ return Ret;
+ if ( StrSize < length2 )
+ {
wchar_t *encoded = (wchar_t*)xf_malloc((length2+1)*sizeof(wchar_t));
-
if (!encoded)
- {
- xf_free(decoded);
- Ret|=SETCP_OTHERERROR;
- return Ret;
- }
-
- length2 = MultiByteToWideChar(codepage, 0, decoded, length, encoded, length2);
- encoded[length2] = L'\0';
- xf_free(decoded);
+ return Ret | SETCP_OTHERERROR;
xf_free(Str);
- Str = encoded;
- StrSize = length2;
+ Str = encoded;
}
+ length2 = MultiByteToWideChar(codepage, 0, decoded, length, Str, length2);
+ Str[StrSize = length2] = L'\0';
+ }
+
+ if ( !check_only )
+ {
m_codepage = codepage;
Changed();
}
-
return Ret;
}
Index: editor.hpp
===================================================================
--- editor.hpp (revision 6272)
+++ editor.hpp (working copy)
@@ -213,6 +213,9 @@
FileEditor *HostFileEditor;
+ char *buffer_line;
+ int buffer_size;
+
private:
virtual void DisplayObject();
void ShowEditor(int CurLineOnly);
@@ -286,7 +289,7 @@
void SetCacheParams(EditorPosCache &pc);
void GetCacheParams(EditorPosCache &pc);
- bool SetCodePage(UINT codepage); //BUGBUG
+ bool SetCodePage(UINT codepage, bool check_only); //BUGBUG
UINT GetCodePage(); //BUGBUG
int SetRawData(const wchar_t *SrcBuf,int SizeSrcBuf,int TextFormat); // �������������� �� ������ � ������
Index: editor.cpp
===================================================================
--- editor.cpp (revision 6272)
+++ editor.cpp (working copy)
@@ -62,6 +62,7 @@
#include "FarDlgBuilder.hpp"
#include "wakeful.hpp"
#include "colormix.hpp"
+#include "codepage.hpp"
static int ReplaceMode,ReplaceAll;
@@ -94,7 +95,9 @@
StackPos(0),
NewStackPos(FALSE),
EditorID(::EditorID++),
- HostFileEditor(nullptr)
+ HostFileEditor(nullptr),
+ buffer_line(nullptr),
+ buffer_size(0)
{
_KEYMACRO(SysLog(L"Editor::Editor()"));
_KEYMACRO(SysLog(1));
@@ -128,6 +131,7 @@
Editor::~Editor()
{
//_SVS(SysLog(L"[%p] Editor::~Editor()",this));
+ delete[] buffer_line;
FreeAllocatedData();
KeepInitParameters();
_KEYMACRO(SysLog(-1));
@@ -5900,7 +5904,7 @@
}
else
{
- SetCodePage(espar->iParam);
+ SetCodePage(espar->iParam, false);
}
Show();
@@ -6739,7 +6743,7 @@
pEdit->SetTabSize(EdOpt.TabSize);
pEdit->SetPersistentBlocks(EdOpt.PersistentBlocks);
pEdit->SetConvertTabs(EdOpt.ExpandTabs);
- pEdit->SetCodePage(m_codepage);
+ pEdit->SetCodePage(m_codepage, false, buffer_line, buffer_size);
if (lpwszStr)
pEdit->SetBinaryString(lpwszStr, nLength);
@@ -6908,25 +6912,40 @@
}
-bool Editor::SetCodePage(UINT codepage)
+bool Editor::SetCodePage( UINT codepage, bool check_onky )
{
- if (m_codepage != codepage)
+ if ( m_codepage == codepage )
+ return true;
+
+ DWORD Result = 0;
+ Edit *current = TopList;
+
+ if ( check_onky )
{
+ if ( IsUnicodeOrUtfCodePage(codepage) != IsUnicodeOrUtfCodePage(m_codepage) )
+ return false;
+
+ while ( current && !Result )
+ {
+ Result |= current->SetCodePage(m_codepage, true, buffer_line, buffer_size);
+ current = current->m_next;
+ }
+
+ }
+ else
+ {
m_codepage = codepage;
- Edit *current = TopList;
- DWORD Result=0;
while (current)
{
- Result|=current->SetCodePage(m_codepage);
+ Result |= current->SetCodePage(m_codepage, false, buffer_line, buffer_size);
current = current->m_next;
}
Show();
- return !Result; // BUGBUG, more details
}
- return true;
+ return (Result == 0); // BUGBUG, more details
}
UINT Editor::GetCodePage()
Index: edit.hpp
===================================================================
--- edit.hpp (revision 6272)
+++ edit.hpp (working copy)
@@ -201,7 +201,7 @@
public:
- DWORD SetCodePage(UINT codepage); //BUGBUG
+ DWORD SetCodePage(UINT codepage, bool check_only, char * &buff, int &bsize); //BUGBUG
UINT GetCodePage(); //BUGBUG
virtual void FastShow();
Index: fileedit.cpp
===================================================================
--- fileedit.cpp (revision 6272)
+++ fileedit.cpp (working copy)
@@ -466,7 +466,7 @@
m_codepage = codepage;
m_editor->SetOwner(this);
- m_editor->SetCodePage(m_codepage);
+ m_editor->SetCodePage(m_codepage, false);
*AttrStr=0;
CurrentEditor=this;
FileAttributes=INVALID_FILE_ATTRIBUTES;
@@ -668,7 +668,7 @@
if (m_codepage==CP_AUTODETECT)
m_codepage=Opt.EdOpt.AnsiCodePageForNewFile?GetACP():GetOEMCP();
- m_editor->SetCodePage(m_codepage);
+ m_editor->SetCodePage(m_codepage, false);
}
CtrlObject->Plugins.CurEditor=this;//&FEdit;
@@ -1297,6 +1297,10 @@
Flags.Set(FFILEEDIT_CODEPAGECHANGEDBYUSER);
ChangeEditKeyBar();
}
+ else
+ {
+ Message(MSG_WARNING,1,MSG(MEditTitle),MSG(MEditorSwitchUnicodeCPDisabled),MSG(MEditorTryReloadFile),MSG(MOk));
+ }
return TRUE;
}
@@ -1309,15 +1313,31 @@
{
File edit_file;
bool detect = false, sig_found = false;
+ wchar_t ss[256];
if (edit_file.Open(strFileName, FILE_READ_DATA, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, nullptr, OPEN_EXISTING))
{
- detect = GetFileFormat(edit_file,codepage,&sig_found,true) && IsCodePageSupported(codepage);
+ detect = GetFileFormat(edit_file,codepage,&sig_found,true);
edit_file.Close();
}
-
- if (!detect)
- codepage = Opt.EdOpt.AnsiCodePageAsDefault ? GetACP() : GetOEMCP();
+ if ( !detect )
+ {
+ Message(MSG_WARNING,1,MSG(MEditTitle),MSG(MEditorCPNotDetected),MSG(MOk));
+ }
+ else if ( IsUnicodeCodePage(codepage) )
+ {
+ detect = false;
+ _snwprintf(ss, ARRAYSIZE(ss), MSG(MEditorSwitchToUnicodeCPDisabled), static_cast<int>(codepage));
+ Message(MSG_WARNING,1,MSG(MEditTitle),ss,MSG(MEditorTryReloadFile),MSG(MOk));
+ }
+ else if ( !IsCodePageSupported(codepage) )
+ {
+ detect = false;
+ _snwprintf(ss, ARRAYSIZE(ss), MSG(MEditorCPNotSupported), static_cast<int>(codepage));
+ Message(MSG_WARNING,1,MSG(MEditTitle),ss,MSG(MOk));
+ }
+ if ( !detect )
+ codepage = static_cast<UINT>(-1);
}
if (codepage != static_cast<UINT>(-1))
@@ -1326,6 +1346,10 @@
Flags.Set(FFILEEDIT_CODEPAGECHANGEDBYUSER);
}
}
+ else
+ {
+ Message(MSG_WARNING,1,MSG(MEditTitle),MSG(MEditorSwitchUnicodeCPDisabled),MSG(MEditorTryReloadFile),MSG(MOk));
+ }
return TRUE;
}
@@ -1548,7 +1572,7 @@
Flags.Set(FFILEEDIT_CODEPAGECHANGEDBYUSER);
}
- m_editor->SetCodePage(m_codepage); //BUGBUG
+ m_editor->SetCodePage(m_codepage, false); //BUGBUG
if (!IsUnicodeOrUtfCodePage(m_codepage))
{
@@ -2790,16 +2814,22 @@
{
if (codepage != m_codepage)
{
- m_codepage = codepage;
-
- if (m_editor)
+ if ( m_editor )
{
- if (!m_editor->SetCodePage(m_codepage))
+ if ( !m_editor->SetCodePage(codepage, true) )
{
- Message(MSG_WARNING,1,MSG(MWarning),MSG(MEditorSwitchCPWarn1),MSG(MEditorSwitchCPWarn2),MSG(MEditorSaveNotRecommended),MSG(MOk));
- BadConversion = true;
+ if (Message(MSG_WARNING,2, MSG(MEditTitle),
+ MSG(MEditorSwitchCPWarn1), MSG(MEditorSwitchCPWarn2),
+ MSG(MDoYouWantToStopWork2), MSG(MHYes), MSG(MHNo)
+ ))
+ return;
}
+ }
+ m_codepage = codepage;
+ if (m_editor)
+ {
+ BadConversion = !m_editor->SetCodePage(m_codepage, false);
ChangeEditKeyBar(); //???
}
}
Index: farlang.templ.m4
===================================================================
--- farlang.templ.m4 (revision 6272)
+++ farlang.templ.m4 (working copy)
@@ -6476,6 +6476,51 @@
upd:"Show"
"Mostrar"
+MEditorSwitchUnicodeCPDisabled
+"Нельзя изменить юникодную кодовую страницу"
+"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+
+MEditorTryReloadFile
+"Можно перечитать файл, указав нужную кодовую страницу (ShiftF4)"
+"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+
+MEditorSwitchToUnicodeCPDisabled
+"Переключение на юникодную кодовую страницу %d не поддерживается"
+"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+
+MEditorCPNotSupported
+"Кодовая страница %d не поддерживается вашей системой"
+"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+
+MEditorCPNotDetected
+"Не удалось определить кодовую страницу"
+"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+
MColumnName
l:
"Имя"
|
|
|
Да, макросами я конечно решил для себя проблему переключения между одно/много-байтными кодировками, и даже кое-как справляюсь с "потерями". Но это ж не дело: надо чтобы нормальная и прозрачная работа с кодировками была сразу из коробки. Фар с последним патчем посмотрю как только появится возможность (собирать пока не могу). |
|
|
пробуй: http://skirda-file.googlecode.com/files/m1773.1.7z Применен патч VerboseCodepageChange.diff |
|
|
>и кстати, хэлп на Autodetect и всю эту тягомотину (если возьмут) за Вами. Ok >если все режимы проверите - будет здорово. Что имеется ввиду под "режимами"? >...вызов диалога релоада с подготовленными параметрами сразу из меню подтверждения/отмены Это всё равно не будет достаточно удобно - фар задаёт пользователю вопросы касательно своих сугубо личных технических ограничений. Между тем в большинстве случаев реально можно было бы обойтись без лишних вопросов: Если несохранённых изменений нет - молча перезагружать. Если есть - только тогда задавать простой вопрос "Перед сменой кодовой страницы необходимо сохранить файл - Да/Отмена". А ещё лучше было бы не задавать и этого вопроса, а при наличии изменений тихо выгружать всё во временный файл, и делать релоад из него. Это было бы вообще идеально, и позволяло бы менять кодировку даже в тех случаях, когда обычный релоад невозможен (например в редакторе не реальный файл). |
|
|
>Ругаемся на все проблемы с перекодировкой в редакторе. >В том числе ДО перекодировки, если будут потери (можно отменить). Может это стоит рассмотреть отдельно? Тикет уже есть: 0000868: Порча текста при смене кодировки на "несовместимую" И ещё: новый диалог практически повторяет уже имеющийся, не лучше ли объединить? Сравните: Editor contains characters, which cannot be correctly translated using selected codepage Continue work? ──────────────────────────────────────────── { Yes } [ No ] Editor contains characters, which cannot be correctly saved using selected codepage. It is not recommended to save this file. ─────────────────────────────────────────── { OK } [ Show ] [ Cancel ] |
|
|
Открываем файл в UTF-8 (FarRus.hlf), и пытаемся его сохранить в 1251. Получаем предупреждение - жмём отмену, и огребаем ещё несколько ворнингов, но на самом деле всё уже свершилось. Отмена не подействовала, т.е. предупреждение было бессмысленным, и от попытки отмены стало только хуже. P.S. На этом эксперименты останавливаю. |
|
|
1> можно отдельно, но код один и тот же и расчленять правки ради соответствия тикетам я пожалуй не буду. диалоги похожи, текст просто взят из одного источника, хотя для перекодировки он не совсем корректен... для второго диалога (Это save) пункт [Show] имеет смысл, для первого - нет один из вариантов текста и так будет показан. |
|
|
2) КАК сохранить? судя по тексту, я думаю ShiftF2... Это не перекодировка, по крайней мере не та часть, которая правилась в рамках этого тикета. Если действительно так - заводите новый. |
|
|
>для второго диалога (Это save) пункт [Show] имеет смысл, для первого - нет Почему нет? Я думаю каждый захочет посмотреть на каком же месте произошёл облом. >КАК сохранить? судя по тексту, я думаю ShiftF2... Не понял о чём это. >Это не перекодировка, по крайней мере не та часть, которая правилась в рамках этого тикета Как же не та, ведь вылазит именно новый диалог. P.S. Каково ваше мнение насчёт http://bugs.farmanager.com/view.php?id=1773#c7042 ? |
|
|
кнопконажимания пожалуйста. |
|
|
>кнопконажимания пожалуйста. Бинарник скачан отсюда: http://skirda-file.googlecode.com/files/m1773.1.7z Курсор стоит на файле FarRus.hlf F4 ShiftF2 Tab CtrlDown 1 Enter N Esc Esc |
|
|
ну да именно об этом и речь код по ShiftF2 ничего не знает о том, что от смены кодировки могли отказаться... придётся и здесь править (наверное завтра). Точно завтра - с первого раза я просто не понял, что делается по ShiftF2. Но наложения от новой перекодировки ему явно на пользу не пошли. |
|
|
VerboseCodepageChange2.diff (13,251 bytes)
Index: edit.cpp
===================================================================
--- edit.cpp (revision 6282)
+++ edit.cpp (working copy)
@@ -135,74 +135,71 @@
xf_free(Str);
}
-DWORD Edit::SetCodePage(UINT codepage)
+DWORD Edit::SetCodePage( UINT codepage, bool check_only, char * &decoded, int &bsize )
{
- DWORD Ret=SETCP_NOERROR;
+ DWORD Ret = SETCP_NOERROR;
+ if (codepage == m_codepage)
+ return Ret;
+
DWORD wc2mbFlags=WC_NO_BEST_FIT_CHARS;
BOOL UsedDefaultChar=FALSE;
LPBOOL lpUsedDefaultChar=&UsedDefaultChar;
-
if (m_codepage==CP_UTF7 || m_codepage==CP_UTF8) // BUGBUG: CP_SYMBOL, 50xxx, 57xxx too
{
wc2mbFlags=0;
lpUsedDefaultChar=nullptr;
}
+ DWORD mb2wcFlags = (codepage == CP_UTF7 ? 0 : MB_ERR_INVALID_CHARS); // BUGBUG: CP_SYMBOL, 50xxx, 57xxx too
- DWORD mb2wcFlags=MB_ERR_INVALID_CHARS;
-
- if (codepage==CP_UTF7) // BUGBUG: CP_SYMBOL, 50xxx, 57xxx too
+ if ( Str )
{
- mb2wcFlags=0;
- }
-
- if (codepage != m_codepage)
- {
- if (Str && *Str)
+ if ( 3*StrSize + 1 > bsize )
{
- //m_codepage = codepage;
- int length = WideCharToMultiByte(m_codepage, wc2mbFlags, Str, StrSize, nullptr, 0, nullptr, lpUsedDefaultChar);
-
- if (UsedDefaultChar)
- Ret|=SETCP_WC2MBERROR;
-
- char *decoded = (char*)xf_malloc(length);
-
- if (!decoded)
+ delete[] decoded;
+ decoded = new char[bsize = 256 + 4*StrSize];
+ if ( !decoded )
{
- Ret|=SETCP_OTHERERROR;
- return Ret;
+ bsize = 0;
+ return Ret | SETCP_OTHERERROR;
}
+ }
- WideCharToMultiByte(m_codepage, 0, Str, StrSize, decoded, length, nullptr, nullptr);
- int length2 = MultiByteToWideChar(codepage, mb2wcFlags, decoded, length, nullptr, 0);
+ int length = WideCharToMultiByte(m_codepage, 0, Str, StrSize, decoded, bsize, nullptr, lpUsedDefaultChar);
+ if (UsedDefaultChar)
+ {
+ Ret |= SETCP_WC2MBERROR;
+ if ( check_only )
+ return Ret;
+ }
- if (!length2 && GetLastError()==ERROR_NO_UNICODE_TRANSLATION)
- {
- Ret|=SETCP_MB2WCERROR;
+ int length2 = MultiByteToWideChar(codepage, mb2wcFlags, decoded, length, nullptr, 0);
+ if (!length2 && GetLastError() == ERROR_NO_UNICODE_TRANSLATION)
+ {
+ Ret |= SETCP_MB2WCERROR;
+ if ( !check_only )
length2 = MultiByteToWideChar(codepage, 0, decoded, length, nullptr, 0);
- }
+ }
+ if ( check_only )
+ return Ret;
+ if ( StrSize < length2 )
+ {
wchar_t *encoded = (wchar_t*)xf_malloc((length2+1)*sizeof(wchar_t));
-
if (!encoded)
- {
- xf_free(decoded);
- Ret|=SETCP_OTHERERROR;
- return Ret;
- }
-
- length2 = MultiByteToWideChar(codepage, 0, decoded, length, encoded, length2);
- encoded[length2] = L'\0';
- xf_free(decoded);
+ return Ret | SETCP_OTHERERROR;
xf_free(Str);
- Str = encoded;
- StrSize = length2;
+ Str = encoded;
}
+ length2 = MultiByteToWideChar(codepage, 0, decoded, length, Str, length2);
+ Str[StrSize = length2] = L'\0';
+ }
+
+ if ( !check_only )
+ {
m_codepage = codepage;
Changed();
}
-
return Ret;
}
Index: editor.hpp
===================================================================
--- editor.hpp (revision 6282)
+++ editor.hpp (working copy)
@@ -213,6 +213,9 @@
FileEditor *HostFileEditor;
+ char *buffer_line;
+ int buffer_size;
+
private:
virtual void DisplayObject();
void ShowEditor(int CurLineOnly);
@@ -286,7 +289,7 @@
void SetCacheParams(EditorPosCache &pc);
void GetCacheParams(EditorPosCache &pc);
- bool SetCodePage(UINT codepage); //BUGBUG
+ bool SetCodePage(UINT codepage, bool check_only); //BUGBUG
UINT GetCodePage(); //BUGBUG
int SetRawData(const wchar_t *SrcBuf,int SizeSrcBuf,int TextFormat); // �������������� �� ������ � ������
Index: editor.cpp
===================================================================
--- editor.cpp (revision 6282)
+++ editor.cpp (working copy)
@@ -62,6 +62,7 @@
#include "FarDlgBuilder.hpp"
#include "wakeful.hpp"
#include "colormix.hpp"
+#include "codepage.hpp"
static int ReplaceMode,ReplaceAll;
@@ -94,7 +95,9 @@
StackPos(0),
NewStackPos(FALSE),
EditorID(::EditorID++),
- HostFileEditor(nullptr)
+ HostFileEditor(nullptr),
+ buffer_line(nullptr),
+ buffer_size(0)
{
_KEYMACRO(SysLog(L"Editor::Editor()"));
_KEYMACRO(SysLog(1));
@@ -128,6 +131,7 @@
Editor::~Editor()
{
//_SVS(SysLog(L"[%p] Editor::~Editor()",this));
+ delete[] buffer_line;
FreeAllocatedData();
KeepInitParameters();
_KEYMACRO(SysLog(-1));
@@ -5900,7 +5904,7 @@
}
else
{
- SetCodePage(espar->iParam);
+ SetCodePage(espar->iParam, false);
}
Show();
@@ -6739,7 +6743,7 @@
pEdit->SetTabSize(EdOpt.TabSize);
pEdit->SetPersistentBlocks(EdOpt.PersistentBlocks);
pEdit->SetConvertTabs(EdOpt.ExpandTabs);
- pEdit->SetCodePage(m_codepage);
+ pEdit->SetCodePage(m_codepage, false, buffer_line, buffer_size);
if (lpwszStr)
pEdit->SetBinaryString(lpwszStr, nLength);
@@ -6908,25 +6912,37 @@
}
-bool Editor::SetCodePage(UINT codepage)
+bool Editor::SetCodePage( UINT codepage, bool check_onky )
{
- if (m_codepage != codepage)
+ if ( m_codepage == codepage )
+ return true;
+
+ DWORD Result = 0;
+ Edit *current = TopList;
+
+ if ( check_onky )
{
+ while ( current && !Result )
+ {
+ Result |= current->SetCodePage(m_codepage, true, buffer_line, buffer_size);
+ current = current->m_next;
+ }
+
+ }
+ else
+ {
m_codepage = codepage;
- Edit *current = TopList;
- DWORD Result=0;
while (current)
{
- Result|=current->SetCodePage(m_codepage);
+ Result |= current->SetCodePage(m_codepage, false, buffer_line, buffer_size);
current = current->m_next;
}
Show();
- return !Result; // BUGBUG, more details
}
- return true;
+ return (Result == 0); // BUGBUG, more details
}
UINT Editor::GetCodePage()
Index: edit.hpp
===================================================================
--- edit.hpp (revision 6282)
+++ edit.hpp (working copy)
@@ -201,7 +201,7 @@
public:
- DWORD SetCodePage(UINT codepage); //BUGBUG
+ DWORD SetCodePage(UINT codepage, bool check_only, char * &buff, int &bsize); //BUGBUG
UINT GetCodePage(); //BUGBUG
virtual void FastShow();
Index: fileedit.cpp
===================================================================
--- fileedit.cpp (revision 6282)
+++ fileedit.cpp (working copy)
@@ -466,7 +466,7 @@
m_codepage = codepage;
m_editor->SetOwner(this);
- m_editor->SetCodePage(m_codepage);
+ m_editor->SetCodePage(m_codepage, false);
*AttrStr=0;
CurrentEditor=this;
FileAttributes=INVALID_FILE_ATTRIBUTES;
@@ -665,10 +665,10 @@
return;
}
- if (m_codepage==CP_AUTODETECT)
+ if ( static_cast<int>(m_codepage) < 0 ) // (m_codepage==CP_AUTODETECT)
m_codepage=Opt.EdOpt.AnsiCodePageForNewFile?GetACP():GetOEMCP();
- m_editor->SetCodePage(m_codepage);
+ m_editor->SetCodePage(m_codepage, false);
}
CtrlObject->Plugins.CurEditor=this;//&FEdit;
@@ -1132,14 +1132,14 @@
{
m_editor->FreeAllocatedData();
m_editor->InsertString(nullptr, 0);
+ m_codepage = codepage; // SetCodePage(codepage); //
}
SetFileName(strFullSaveAsName);
- SetCodePage(codepage); //
if (!bInPlace)
{
- Message(MSG_WARNING, 1, L"WARNING!", L"Editor will be reopened with new file!", MSG(MOk));
+ //Message(MSG_WARNING, 1, L"WARNING!", L"Editor will be reopened with new file!", MSG(MOk));
int UserBreak;
LoadFile(strFullSaveAsName, UserBreak);
// TODO: �������� ������� ���� ��� ���� ����� (copy/paste �� FileEditor::Init()). ������� ��� ����� �� �����
@@ -1297,6 +1297,10 @@
Flags.Set(FFILEEDIT_CODEPAGECHANGEDBYUSER);
ChangeEditKeyBar();
}
+ else
+ {
+ Message(MSG_WARNING,1,MSG(MEditTitle),MSG(MEditorSwitchUnicodeCPDisabled),MSG(MEditorTryReloadFile),MSG(MOk));
+ }
return TRUE;
}
@@ -1309,15 +1313,31 @@
{
File edit_file;
bool detect = false, sig_found = false;
+ wchar_t ss[256];
if (edit_file.Open(strFileName, FILE_READ_DATA, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, nullptr, OPEN_EXISTING))
{
- detect = GetFileFormat(edit_file,codepage,&sig_found,true) && IsCodePageSupported(codepage);
+ detect = GetFileFormat(edit_file,codepage,&sig_found,true);
edit_file.Close();
}
-
- if (!detect)
- codepage = Opt.EdOpt.AnsiCodePageAsDefault ? GetACP() : GetOEMCP();
+ if ( !detect )
+ {
+ Message(MSG_WARNING,1,MSG(MEditTitle),MSG(MEditorCPNotDetected),MSG(MOk));
+ }
+ else if ( IsUnicodeCodePage(codepage) )
+ {
+ detect = false;
+ _snwprintf(ss, ARRAYSIZE(ss), MSG(MEditorSwitchToUnicodeCPDisabled), static_cast<int>(codepage));
+ Message(MSG_WARNING,1,MSG(MEditTitle),ss,MSG(MEditorTryReloadFile),MSG(MOk));
+ }
+ else if ( !IsCodePageSupported(codepage) )
+ {
+ detect = false;
+ _snwprintf(ss, ARRAYSIZE(ss), MSG(MEditorCPNotSupported), static_cast<int>(codepage));
+ Message(MSG_WARNING,1,MSG(MEditTitle),ss,MSG(MOk));
+ }
+ if ( !detect )
+ codepage = static_cast<UINT>(-1);
}
if (codepage != static_cast<UINT>(-1))
@@ -1326,6 +1346,10 @@
Flags.Set(FFILEEDIT_CODEPAGECHANGEDBYUSER);
}
}
+ else
+ {
+ Message(MSG_WARNING,1,MSG(MEditTitle),MSG(MEditorSwitchUnicodeCPDisabled),MSG(MEditorTryReloadFile),MSG(MOk));
+ }
return TRUE;
}
@@ -1548,7 +1572,7 @@
Flags.Set(FFILEEDIT_CODEPAGECHANGEDBYUSER);
}
- m_editor->SetCodePage(m_codepage); //BUGBUG
+ m_editor->SetCodePage(m_codepage, false); //BUGBUG
if (!IsUnicodeOrUtfCodePage(m_codepage))
{
@@ -2790,16 +2814,22 @@
{
if (codepage != m_codepage)
{
- m_codepage = codepage;
-
- if (m_editor)
+ if ( m_editor )
{
- if (!m_editor->SetCodePage(m_codepage))
+ if ( !m_editor->SetCodePage(codepage, true) )
{
- Message(MSG_WARNING,1,MSG(MWarning),MSG(MEditorSwitchCPWarn1),MSG(MEditorSwitchCPWarn2),MSG(MEditorSaveNotRecommended),MSG(MOk));
- BadConversion = true;
+ if (Message(MSG_WARNING,2, MSG(MEditTitle),
+ MSG(MEditorSwitchCPWarn1), MSG(MEditorSwitchCPWarn2),
+ MSG(MDoYouWantToStopWork2), MSG(MHYes), MSG(MHNo)
+ ))
+ return;
}
+ }
+ m_codepage = codepage;
+ if (m_editor)
+ {
+ BadConversion = !m_editor->SetCodePage(m_codepage, false);
ChangeEditKeyBar(); //???
}
}
Index: farlang.templ.m4
===================================================================
--- farlang.templ.m4 (revision 6282)
+++ farlang.templ.m4 (working copy)
@@ -6476,6 +6476,51 @@
upd:"Show"
"Mostrar"
+MEditorSwitchUnicodeCPDisabled
+"Нельзя изменить юникодную кодовую страницу"
+"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+
+MEditorTryReloadFile
+"Можно перечитать файл, указав нужную кодовую страницу (ShiftF4)"
+"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+
+MEditorSwitchToUnicodeCPDisabled
+"Переключение на юникодную кодовую страницу %d не поддерживается"
+"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+
+MEditorCPNotSupported
+"Кодовая страница %d не поддерживается вашей системой"
+"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+
+MEditorCPNotDetected
+"Не удалось определить кодовую страницу"
+"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+
MColumnName
l:
"Имя"
|
|
|
завтра. поправил. автодетект несуществующего файла тоже здесь. насчет записи во временный изменений... на мой взгляд, это не решает проблему - измененные данные уже могут быть испорчены (да и как известно "не нянька" :) |
|
|
>на мой взгляд, это не решает проблему Это смотря какую. Основная цель этого - сделать работу с кодировками максимально прозрачной для пользователя. Избавиться от абсолютно ненужных запросов. >измененные данные уже могут быть испорчены С чего это они будут испорчены? >(да и как известно "не нянька" :) Не нянька, но инструмент. Я хочу просто сменить кодировку. Я не хочу менять данные. Это реально сделать (не утверждаю что просто). |
|
|
да проблему надо понимать одинаково. мне текущее поведение кажется достаточно 'прозрачным'. если что-то не так: кнопконажимания + что плохо? + как хорошо? |
|
|
Переключение кодировки файла - вопрос чисто технический. Вопросы к пользователю должны возникать только если действительно невозможно представить имеющиеся данные в заданной кодировке. Фар же (в связи с текущими особенностями архитектуры редактора) не умеет переключать кодировку в ряде вполне корректных случаев. И свои внутренние проблемы перекладывает на пользователя - говорит мол я сам не могу, переключай ты. Очевидно, что ничего хорошего в этом нет, и желательно научить редактор справляться самостоятельно (где это возможно). |
|
|
VerboseCodepageChange3.diff (14,135 bytes)
Index: edit.cpp
===================================================================
--- edit.cpp (revision 6296)
+++ edit.cpp (working copy)
@@ -135,74 +135,71 @@
xf_free(Str);
}
-DWORD Edit::SetCodePage(UINT codepage)
+DWORD Edit::SetCodePage( UINT codepage, bool check_only, char * &decoded, int &bsize )
{
- DWORD Ret=SETCP_NOERROR;
+ DWORD Ret = SETCP_NOERROR;
+ if (codepage == m_codepage)
+ return Ret;
+
DWORD wc2mbFlags=WC_NO_BEST_FIT_CHARS;
BOOL UsedDefaultChar=FALSE;
LPBOOL lpUsedDefaultChar=&UsedDefaultChar;
-
if (m_codepage==CP_UTF7 || m_codepage==CP_UTF8) // BUGBUG: CP_SYMBOL, 50xxx, 57xxx too
{
wc2mbFlags=0;
lpUsedDefaultChar=nullptr;
}
+ DWORD mb2wcFlags = (codepage == CP_UTF7 ? 0 : MB_ERR_INVALID_CHARS); // BUGBUG: CP_SYMBOL, 50xxx, 57xxx too
- DWORD mb2wcFlags=MB_ERR_INVALID_CHARS;
-
- if (codepage==CP_UTF7) // BUGBUG: CP_SYMBOL, 50xxx, 57xxx too
+ if ( Str )
{
- mb2wcFlags=0;
- }
-
- if (codepage != m_codepage)
- {
- if (Str && *Str)
+ if ( 3*StrSize + 1 > bsize )
{
- //m_codepage = codepage;
- int length = WideCharToMultiByte(m_codepage, wc2mbFlags, Str, StrSize, nullptr, 0, nullptr, lpUsedDefaultChar);
-
- if (UsedDefaultChar)
- Ret|=SETCP_WC2MBERROR;
-
- char *decoded = (char*)xf_malloc(length);
-
- if (!decoded)
+ delete[] decoded;
+ decoded = new char[bsize = 256 + 4*StrSize];
+ if ( !decoded )
{
- Ret|=SETCP_OTHERERROR;
- return Ret;
+ bsize = 0;
+ return Ret | SETCP_OTHERERROR;
}
+ }
- WideCharToMultiByte(m_codepage, 0, Str, StrSize, decoded, length, nullptr, nullptr);
- int length2 = MultiByteToWideChar(codepage, mb2wcFlags, decoded, length, nullptr, 0);
+ int length = WideCharToMultiByte(m_codepage, 0, Str, StrSize, decoded, bsize, nullptr, lpUsedDefaultChar);
+ if (UsedDefaultChar)
+ {
+ Ret |= SETCP_WC2MBERROR;
+ if ( check_only )
+ return Ret;
+ }
- if (!length2 && GetLastError()==ERROR_NO_UNICODE_TRANSLATION)
- {
- Ret|=SETCP_MB2WCERROR;
+ int length2 = MultiByteToWideChar(codepage, mb2wcFlags, decoded, length, nullptr, 0);
+ if (!length2 && GetLastError() == ERROR_NO_UNICODE_TRANSLATION)
+ {
+ Ret |= SETCP_MB2WCERROR;
+ if ( !check_only )
length2 = MultiByteToWideChar(codepage, 0, decoded, length, nullptr, 0);
- }
+ }
+ if ( check_only )
+ return Ret;
+ if ( StrSize < length2 )
+ {
wchar_t *encoded = (wchar_t*)xf_malloc((length2+1)*sizeof(wchar_t));
-
if (!encoded)
- {
- xf_free(decoded);
- Ret|=SETCP_OTHERERROR;
- return Ret;
- }
-
- length2 = MultiByteToWideChar(codepage, 0, decoded, length, encoded, length2);
- encoded[length2] = L'\0';
- xf_free(decoded);
+ return Ret | SETCP_OTHERERROR;
xf_free(Str);
Str = encoded;
- StrSize = length2;
}
+ length2 = MultiByteToWideChar(codepage, 0, decoded, length, Str, length2);
+ Str[StrSize = length2] = L'\0';
+ }
+
+ if ( !check_only )
+ {
m_codepage = codepage;
Changed();
}
-
return Ret;
}
@@ -3106,7 +3103,7 @@
int MenuKey=InputRecordToKey(&ir);
// ����
- if((MenuKey>=L' ' && MenuKey<=WCHAR_MAX) || MenuKey==KEY_BS || MenuKey==KEY_DEL || MenuKey==KEY_NUMDEL)
+ if((MenuKey>=static_cast<int>(L' ') && MenuKey<=static_cast<int>(WCHAR_MAX)) || MenuKey==KEY_BS || MenuKey==KEY_DEL || MenuKey==KEY_NUMDEL)
{
string strPrev;
DeleteBlock();
Index: editor.hpp
===================================================================
--- editor.hpp (revision 6296)
+++ editor.hpp (working copy)
@@ -213,6 +213,9 @@
FileEditor *HostFileEditor;
+ char *buffer_line;
+ int buffer_size;
+
private:
virtual void DisplayObject();
void ShowEditor(int CurLineOnly);
@@ -286,7 +289,7 @@
void SetCacheParams(EditorPosCache &pc);
void GetCacheParams(EditorPosCache &pc);
- bool SetCodePage(UINT codepage); //BUGBUG
+ bool SetCodePage(UINT codepage, bool check_only); //BUGBUG
UINT GetCodePage(); //BUGBUG
int SetRawData(const wchar_t *SrcBuf,int SizeSrcBuf,int TextFormat); // �������������� �� ������ � ������
Index: codepage.cpp
===================================================================
--- codepage.cpp (revision 6296)
+++ codepage.cpp (working copy)
@@ -721,7 +721,7 @@
case KEY_CTRLH:
Opt.CPMenuMode = !Opt.CPMenuMode;
CodePages->SetBottomTitle(MSG(!Opt.CPMenuMode?MGetCodePageBottomTitle:MGetCodePageBottomShortTitle));
- FillCodePagesVMenu(bShowUnicode, bShowUTF, bShowUTF7);
+ FillCodePagesVMenu(bShowUnicode, bShowUTF, bShowUTF7, bShowAutoDetect);
break;
// ��������� ������� ����� �������� �� ������ ������
case KEY_DEL:
Index: editor.cpp
===================================================================
--- editor.cpp (revision 6296)
+++ editor.cpp (working copy)
@@ -62,6 +62,7 @@
#include "FarDlgBuilder.hpp"
#include "wakeful.hpp"
#include "colormix.hpp"
+#include "codepage.hpp"
static int ReplaceMode,ReplaceAll;
@@ -94,7 +95,9 @@
StackPos(0),
NewStackPos(FALSE),
EditorID(::EditorID++),
- HostFileEditor(nullptr)
+ HostFileEditor(nullptr),
+ buffer_line(nullptr),
+ buffer_size(0)
{
_KEYMACRO(SysLog(L"Editor::Editor()"));
_KEYMACRO(SysLog(1));
@@ -128,6 +131,7 @@
Editor::~Editor()
{
//_SVS(SysLog(L"[%p] Editor::~Editor()",this));
+ delete[] buffer_line;
FreeAllocatedData();
KeepInitParameters();
_KEYMACRO(SysLog(-1));
@@ -5910,7 +5914,7 @@
}
else
{
- SetCodePage(espar->iParam);
+ SetCodePage(espar->iParam, false);
}
Show();
@@ -6749,7 +6753,7 @@
pEdit->SetTabSize(EdOpt.TabSize);
pEdit->SetPersistentBlocks(EdOpt.PersistentBlocks);
pEdit->SetConvertTabs(EdOpt.ExpandTabs);
- pEdit->SetCodePage(m_codepage);
+ pEdit->SetCodePage(m_codepage, false, buffer_line, buffer_size);
if (lpwszStr)
pEdit->SetBinaryString(lpwszStr, nLength);
@@ -6918,25 +6922,37 @@
}
-bool Editor::SetCodePage(UINT codepage)
+bool Editor::SetCodePage( UINT codepage, bool check_onky )
{
- if (m_codepage != codepage)
+ if ( m_codepage == codepage )
+ return true;
+
+ DWORD Result = 0;
+ Edit *current = TopList;
+
+ if ( check_onky )
{
+ while ( current && !Result )
+ {
+ Result |= current->SetCodePage(m_codepage, true, buffer_line, buffer_size);
+ current = current->m_next;
+ }
+
+ }
+ else
+ {
m_codepage = codepage;
- Edit *current = TopList;
- DWORD Result=0;
while (current)
{
- Result|=current->SetCodePage(m_codepage);
+ Result |= current->SetCodePage(m_codepage, false, buffer_line, buffer_size);
current = current->m_next;
}
Show();
- return !Result; // BUGBUG, more details
}
- return true;
+ return (Result == 0); // BUGBUG, more details
}
UINT Editor::GetCodePage()
Index: edit.hpp
===================================================================
--- edit.hpp (revision 6296)
+++ edit.hpp (working copy)
@@ -201,7 +201,7 @@
public:
- DWORD SetCodePage(UINT codepage); //BUGBUG
+ DWORD SetCodePage(UINT codepage, bool check_only, char * &buff, int &bsize); //BUGBUG
UINT GetCodePage(); //BUGBUG
virtual void FastShow();
Index: fileedit.cpp
===================================================================
--- fileedit.cpp (revision 6296)
+++ fileedit.cpp (working copy)
@@ -466,7 +466,7 @@
m_codepage = codepage;
m_editor->SetOwner(this);
- m_editor->SetCodePage(m_codepage);
+ m_editor->SetCodePage(m_codepage, false);
*AttrStr=0;
CurrentEditor=this;
FileAttributes=INVALID_FILE_ATTRIBUTES;
@@ -668,7 +668,7 @@
if (m_codepage==CP_AUTODETECT || m_codepage == CP_REDETECT)
m_codepage=Opt.EdOpt.AnsiCodePageForNewFile?GetACP():GetOEMCP();
- m_editor->SetCodePage(m_codepage);
+ m_editor->SetCodePage(m_codepage, false);
}
CtrlObject->Plugins.CurEditor=this;//&FEdit;
@@ -1132,14 +1132,14 @@
{
m_editor->FreeAllocatedData();
m_editor->InsertString(nullptr, 0);
+ m_codepage = codepage; // SetCodePage(codepage); //
}
SetFileName(strFullSaveAsName);
- SetCodePage(codepage); //
if (!bInPlace)
{
- Message(MSG_WARNING, 1, L"WARNING!", L"Editor will be reopened with new file!", MSG(MOk));
+ //Message(MSG_WARNING, 1, L"WARNING!", L"Editor will be reopened with new file!", MSG(MOk));
int UserBreak;
LoadFile(strFullSaveAsName, UserBreak);
// TODO: �������� ������� ���� ��� ���� ����� (copy/paste �� FileEditor::Init()). ������� ��� ����� �� �����
@@ -1297,6 +1297,10 @@
Flags.Set(FFILEEDIT_CODEPAGECHANGEDBYUSER);
ChangeEditKeyBar();
}
+ else
+ {
+ Message(MSG_WARNING,1,MSG(MEditTitle),MSG(MEditorSwitchUnicodeCPDisabled),MSG(MEditorTryReloadFile),MSG(MOk));
+ }
return TRUE;
}
@@ -1309,15 +1313,31 @@
{
File edit_file;
bool detect = false, sig_found = false;
+ wchar_t ss[256];
if (edit_file.Open(strFileName, FILE_READ_DATA, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, nullptr, OPEN_EXISTING))
{
- detect = GetFileFormat(edit_file,codepage,&sig_found,true) && IsCodePageSupported(codepage);
+ detect = GetFileFormat(edit_file,codepage,&sig_found,true);
edit_file.Close();
}
-
- if (!detect)
- codepage = Opt.EdOpt.AnsiCodePageAsDefault ? GetACP() : GetOEMCP();
+ if ( !detect )
+ {
+ Message(MSG_WARNING,1,MSG(MEditTitle),MSG(MEditorCPNotDetected),MSG(MOk));
+ }
+ else if ( IsUnicodeCodePage(codepage) )
+ {
+ detect = false;
+ _snwprintf(ss, ARRAYSIZE(ss), MSG(MEditorSwitchToUnicodeCPDisabled), static_cast<int>(codepage));
+ Message(MSG_WARNING,1,MSG(MEditTitle),ss,MSG(MEditorTryReloadFile),MSG(MOk));
+ }
+ else if ( !IsCodePageSupported(codepage) )
+ {
+ detect = false;
+ _snwprintf(ss, ARRAYSIZE(ss), MSG(MEditorCPNotSupported), static_cast<int>(codepage));
+ Message(MSG_WARNING,1,MSG(MEditTitle),ss,MSG(MOk));
+ }
+ if ( !detect )
+ codepage = static_cast<UINT>(-1);
}
if (codepage != static_cast<UINT>(-1))
@@ -1326,6 +1346,10 @@
Flags.Set(FFILEEDIT_CODEPAGECHANGEDBYUSER);
}
}
+ else
+ {
+ Message(MSG_WARNING,1,MSG(MEditTitle),MSG(MEditorSwitchUnicodeCPDisabled),MSG(MEditorTryReloadFile),MSG(MOk));
+ }
return TRUE;
}
@@ -1548,7 +1572,7 @@
Flags.Set(FFILEEDIT_CODEPAGECHANGEDBYUSER);
}
- m_editor->SetCodePage(m_codepage); //BUGBUG
+ m_editor->SetCodePage(m_codepage, false); //BUGBUG
if (!IsUnicodeOrUtfCodePage(m_codepage))
{
@@ -2790,16 +2814,22 @@
{
if (codepage != m_codepage)
{
- m_codepage = codepage;
-
- if (m_editor)
+ if ( m_editor )
{
- if (!m_editor->SetCodePage(m_codepage))
+ if ( !m_editor->SetCodePage(codepage, true) )
{
- Message(MSG_WARNING,1,MSG(MWarning),MSG(MEditorSwitchCPWarn1),MSG(MEditorSwitchCPWarn2),MSG(MEditorSaveNotRecommended),MSG(MOk));
- BadConversion = true;
+ if (Message(MSG_WARNING,2, MSG(MEditTitle),
+ MSG(MEditorSwitchCPWarn1), MSG(MEditorSwitchCPWarn2),
+ MSG(MDoYouWantToStopWork2), MSG(MHYes), MSG(MHNo)
+ ))
+ return;
}
+ }
+ m_codepage = codepage;
+ if (m_editor)
+ {
+ BadConversion = !m_editor->SetCodePage(m_codepage, false);
ChangeEditKeyBar(); //???
}
}
Index: farlang.templ.m4
===================================================================
--- farlang.templ.m4 (revision 6296)
+++ farlang.templ.m4 (working copy)
@@ -6476,6 +6476,51 @@
upd:"Show"
"Mostrar"
+MEditorSwitchUnicodeCPDisabled
+"Нельзя изменить юникодную кодовую страницу"
+"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+
+MEditorTryReloadFile
+"Можно перечитать файл, указав нужную кодовую страницу (ShiftF4)"
+"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+
+MEditorSwitchToUnicodeCPDisabled
+"Переключение на юникодную кодовую страницу %d не поддерживается"
+"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+
+MEditorCPNotSupported
+"Кодовая страница %d не поддерживается вашей системой"
+"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+
+MEditorCPNotDetected
+"Не удалось определить кодовую страницу"
+"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+
MColumnName
l:
"Имя"
|
|
|
фикс(3): псле Ctrl-H в меню кодировок автодетект дизейблился +фикс(4): не работал редетект по Shift-F4, если автодетект отключен в настойках редактора |
|
|
VerboseCodepageChange4.diff (14,903 bytes)
Index: edit.cpp
===================================================================
--- edit.cpp (revision 6296)
+++ edit.cpp (working copy)
@@ -135,74 +135,71 @@
xf_free(Str);
}
-DWORD Edit::SetCodePage(UINT codepage)
+DWORD Edit::SetCodePage( UINT codepage, bool check_only, char * &decoded, int &bsize )
{
- DWORD Ret=SETCP_NOERROR;
+ DWORD Ret = SETCP_NOERROR;
+ if (codepage == m_codepage)
+ return Ret;
+
DWORD wc2mbFlags=WC_NO_BEST_FIT_CHARS;
BOOL UsedDefaultChar=FALSE;
LPBOOL lpUsedDefaultChar=&UsedDefaultChar;
-
if (m_codepage==CP_UTF7 || m_codepage==CP_UTF8) // BUGBUG: CP_SYMBOL, 50xxx, 57xxx too
{
wc2mbFlags=0;
lpUsedDefaultChar=nullptr;
}
+ DWORD mb2wcFlags = (codepage == CP_UTF7 ? 0 : MB_ERR_INVALID_CHARS); // BUGBUG: CP_SYMBOL, 50xxx, 57xxx too
- DWORD mb2wcFlags=MB_ERR_INVALID_CHARS;
-
- if (codepage==CP_UTF7) // BUGBUG: CP_SYMBOL, 50xxx, 57xxx too
+ if ( Str )
{
- mb2wcFlags=0;
- }
-
- if (codepage != m_codepage)
- {
- if (Str && *Str)
+ if ( 3*StrSize + 1 > bsize )
{
- //m_codepage = codepage;
- int length = WideCharToMultiByte(m_codepage, wc2mbFlags, Str, StrSize, nullptr, 0, nullptr, lpUsedDefaultChar);
-
- if (UsedDefaultChar)
- Ret|=SETCP_WC2MBERROR;
-
- char *decoded = (char*)xf_malloc(length);
-
- if (!decoded)
+ delete[] decoded;
+ decoded = new char[bsize = 256 + 4*StrSize];
+ if ( !decoded )
{
- Ret|=SETCP_OTHERERROR;
- return Ret;
+ bsize = 0;
+ return Ret | SETCP_OTHERERROR;
}
+ }
- WideCharToMultiByte(m_codepage, 0, Str, StrSize, decoded, length, nullptr, nullptr);
- int length2 = MultiByteToWideChar(codepage, mb2wcFlags, decoded, length, nullptr, 0);
+ int length = WideCharToMultiByte(m_codepage, 0, Str, StrSize, decoded, bsize, nullptr, lpUsedDefaultChar);
+ if (UsedDefaultChar)
+ {
+ Ret |= SETCP_WC2MBERROR;
+ if ( check_only )
+ return Ret;
+ }
- if (!length2 && GetLastError()==ERROR_NO_UNICODE_TRANSLATION)
- {
- Ret|=SETCP_MB2WCERROR;
+ int length2 = MultiByteToWideChar(codepage, mb2wcFlags, decoded, length, nullptr, 0);
+ if (!length2 && GetLastError() == ERROR_NO_UNICODE_TRANSLATION)
+ {
+ Ret |= SETCP_MB2WCERROR;
+ if ( !check_only )
length2 = MultiByteToWideChar(codepage, 0, decoded, length, nullptr, 0);
- }
+ }
+ if ( check_only )
+ return Ret;
+ if ( StrSize < length2 )
+ {
wchar_t *encoded = (wchar_t*)xf_malloc((length2+1)*sizeof(wchar_t));
-
if (!encoded)
- {
- xf_free(decoded);
- Ret|=SETCP_OTHERERROR;
- return Ret;
- }
-
- length2 = MultiByteToWideChar(codepage, 0, decoded, length, encoded, length2);
- encoded[length2] = L'\0';
- xf_free(decoded);
+ return Ret | SETCP_OTHERERROR;
xf_free(Str);
Str = encoded;
- StrSize = length2;
}
+ length2 = MultiByteToWideChar(codepage, 0, decoded, length, Str, length2);
+ Str[StrSize = length2] = L'\0';
+ }
+
+ if ( !check_only )
+ {
m_codepage = codepage;
Changed();
}
-
return Ret;
}
@@ -3106,7 +3103,7 @@
int MenuKey=InputRecordToKey(&ir);
// ����
- if((MenuKey>=L' ' && MenuKey<=WCHAR_MAX) || MenuKey==KEY_BS || MenuKey==KEY_DEL || MenuKey==KEY_NUMDEL)
+ if((MenuKey>=static_cast<int>(L' ') && MenuKey<=static_cast<int>(WCHAR_MAX)) || MenuKey==KEY_BS || MenuKey==KEY_DEL || MenuKey==KEY_NUMDEL)
{
string strPrev;
DeleteBlock();
Index: editor.hpp
===================================================================
--- editor.hpp (revision 6296)
+++ editor.hpp (working copy)
@@ -213,6 +213,9 @@
FileEditor *HostFileEditor;
+ char *buffer_line;
+ int buffer_size;
+
private:
virtual void DisplayObject();
void ShowEditor(int CurLineOnly);
@@ -286,7 +289,7 @@
void SetCacheParams(EditorPosCache &pc);
void GetCacheParams(EditorPosCache &pc);
- bool SetCodePage(UINT codepage); //BUGBUG
+ bool SetCodePage(UINT codepage, bool check_only); //BUGBUG
UINT GetCodePage(); //BUGBUG
int SetRawData(const wchar_t *SrcBuf,int SizeSrcBuf,int TextFormat); // �������������� �� ������ � ������
Index: codepage.cpp
===================================================================
--- codepage.cpp (revision 6296)
+++ codepage.cpp (working copy)
@@ -721,7 +721,7 @@
case KEY_CTRLH:
Opt.CPMenuMode = !Opt.CPMenuMode;
CodePages->SetBottomTitle(MSG(!Opt.CPMenuMode?MGetCodePageBottomTitle:MGetCodePageBottomShortTitle));
- FillCodePagesVMenu(bShowUnicode, bShowUTF, bShowUTF7);
+ FillCodePagesVMenu(bShowUnicode, bShowUTF, bShowUTF7, bShowAutoDetect);
break;
// ��������� ������� ����� �������� �� ������ ������
case KEY_DEL:
Index: editor.cpp
===================================================================
--- editor.cpp (revision 6296)
+++ editor.cpp (working copy)
@@ -62,6 +62,7 @@
#include "FarDlgBuilder.hpp"
#include "wakeful.hpp"
#include "colormix.hpp"
+#include "codepage.hpp"
static int ReplaceMode,ReplaceAll;
@@ -94,7 +95,9 @@
StackPos(0),
NewStackPos(FALSE),
EditorID(::EditorID++),
- HostFileEditor(nullptr)
+ HostFileEditor(nullptr),
+ buffer_line(nullptr),
+ buffer_size(0)
{
_KEYMACRO(SysLog(L"Editor::Editor()"));
_KEYMACRO(SysLog(1));
@@ -128,6 +131,7 @@
Editor::~Editor()
{
//_SVS(SysLog(L"[%p] Editor::~Editor()",this));
+ delete[] buffer_line;
FreeAllocatedData();
KeepInitParameters();
_KEYMACRO(SysLog(-1));
@@ -5910,7 +5914,7 @@
}
else
{
- SetCodePage(espar->iParam);
+ SetCodePage(espar->iParam, false);
}
Show();
@@ -6749,7 +6753,7 @@
pEdit->SetTabSize(EdOpt.TabSize);
pEdit->SetPersistentBlocks(EdOpt.PersistentBlocks);
pEdit->SetConvertTabs(EdOpt.ExpandTabs);
- pEdit->SetCodePage(m_codepage);
+ pEdit->SetCodePage(m_codepage, false, buffer_line, buffer_size);
if (lpwszStr)
pEdit->SetBinaryString(lpwszStr, nLength);
@@ -6918,25 +6922,37 @@
}
-bool Editor::SetCodePage(UINT codepage)
+bool Editor::SetCodePage( UINT codepage, bool check_onky )
{
- if (m_codepage != codepage)
+ if ( m_codepage == codepage )
+ return true;
+
+ DWORD Result = 0;
+ Edit *current = TopList;
+
+ if ( check_onky )
{
+ while ( current && !Result )
+ {
+ Result |= current->SetCodePage(m_codepage, true, buffer_line, buffer_size);
+ current = current->m_next;
+ }
+
+ }
+ else
+ {
m_codepage = codepage;
- Edit *current = TopList;
- DWORD Result=0;
while (current)
{
- Result|=current->SetCodePage(m_codepage);
+ Result |= current->SetCodePage(m_codepage, false, buffer_line, buffer_size);
current = current->m_next;
}
Show();
- return !Result; // BUGBUG, more details
}
- return true;
+ return (Result == 0); // BUGBUG, more details
}
UINT Editor::GetCodePage()
Index: edit.hpp
===================================================================
--- edit.hpp (revision 6296)
+++ edit.hpp (working copy)
@@ -201,7 +201,7 @@
public:
- DWORD SetCodePage(UINT codepage); //BUGBUG
+ DWORD SetCodePage(UINT codepage, bool check_only, char * &buff, int &bsize); //BUGBUG
UINT GetCodePage(); //BUGBUG
virtual void FastShow();
Index: fileedit.cpp
===================================================================
--- fileedit.cpp (revision 6296)
+++ fileedit.cpp (working copy)
@@ -466,7 +466,7 @@
m_codepage = codepage;
m_editor->SetOwner(this);
- m_editor->SetCodePage(m_codepage);
+ m_editor->SetCodePage(m_codepage, false);
*AttrStr=0;
CurrentEditor=this;
FileAttributes=INVALID_FILE_ATTRIBUTES;
@@ -668,7 +668,7 @@
if (m_codepage==CP_AUTODETECT || m_codepage == CP_REDETECT)
m_codepage=Opt.EdOpt.AnsiCodePageForNewFile?GetACP():GetOEMCP();
- m_editor->SetCodePage(m_codepage);
+ m_editor->SetCodePage(m_codepage, false);
}
CtrlObject->Plugins.CurEditor=this;//&FEdit;
@@ -1132,14 +1132,14 @@
{
m_editor->FreeAllocatedData();
m_editor->InsertString(nullptr, 0);
+ m_codepage = codepage; // SetCodePage(codepage); //
}
SetFileName(strFullSaveAsName);
- SetCodePage(codepage); //
if (!bInPlace)
{
- Message(MSG_WARNING, 1, L"WARNING!", L"Editor will be reopened with new file!", MSG(MOk));
+ //Message(MSG_WARNING, 1, L"WARNING!", L"Editor will be reopened with new file!", MSG(MOk));
int UserBreak;
LoadFile(strFullSaveAsName, UserBreak);
// TODO: �������� ������� ���� ��� ���� ����� (copy/paste �� FileEditor::Init()). ������� ��� ����� �� �����
@@ -1297,6 +1297,10 @@
Flags.Set(FFILEEDIT_CODEPAGECHANGEDBYUSER);
ChangeEditKeyBar();
}
+ else
+ {
+ Message(MSG_WARNING,1,MSG(MEditTitle),MSG(MEditorSwitchUnicodeCPDisabled),MSG(MEditorTryReloadFile),MSG(MOk));
+ }
return TRUE;
}
@@ -1309,15 +1313,31 @@
{
File edit_file;
bool detect = false, sig_found = false;
+ wchar_t ss[256];
if (edit_file.Open(strFileName, FILE_READ_DATA, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, nullptr, OPEN_EXISTING))
{
- detect = GetFileFormat(edit_file,codepage,&sig_found,true) && IsCodePageSupported(codepage);
+ detect = GetFileFormat(edit_file,codepage,&sig_found,true);
edit_file.Close();
}
-
- if (!detect)
- codepage = Opt.EdOpt.AnsiCodePageAsDefault ? GetACP() : GetOEMCP();
+ if ( !detect )
+ {
+ Message(MSG_WARNING,1,MSG(MEditTitle),MSG(MEditorCPNotDetected),MSG(MOk));
+ }
+ else if ( IsUnicodeCodePage(codepage) )
+ {
+ detect = false;
+ _snwprintf(ss, ARRAYSIZE(ss), MSG(MEditorSwitchToUnicodeCPDisabled), static_cast<int>(codepage));
+ Message(MSG_WARNING,1,MSG(MEditTitle),ss,MSG(MEditorTryReloadFile),MSG(MOk));
+ }
+ else if ( !IsCodePageSupported(codepage) )
+ {
+ detect = false;
+ _snwprintf(ss, ARRAYSIZE(ss), MSG(MEditorCPNotSupported), static_cast<int>(codepage));
+ Message(MSG_WARNING,1,MSG(MEditTitle),ss,MSG(MOk));
+ }
+ if ( !detect )
+ codepage = static_cast<UINT>(-1);
}
if (codepage != static_cast<UINT>(-1))
@@ -1326,6 +1346,10 @@
Flags.Set(FFILEEDIT_CODEPAGECHANGEDBYUSER);
}
}
+ else
+ {
+ Message(MSG_WARNING,1,MSG(MEditTitle),MSG(MEditorSwitchUnicodeCPDisabled),MSG(MEditorTryReloadFile),MSG(MOk));
+ }
return TRUE;
}
@@ -1511,13 +1535,13 @@
UINT dwCP=0;
bool Detect=false;
- bool ignore_cached_cp = (m_codepage == CP_REDETECT);
- if (ignore_cached_cp)
+ bool redetect = (m_codepage == CP_REDETECT);
+ if (redetect)
m_codepage = CP_AUTODETECT;
if (m_codepage == CP_AUTODETECT || IsUnicodeOrUtfCodePage(m_codepage))
{
- Detect=GetFileFormat(EditFile,dwCP,&m_bAddSignature,Opt.EdOpt.AutoDetectCodePage!=0);
+ Detect=GetFileFormat(EditFile,dwCP,&m_bAddSignature,redetect || Opt.EdOpt.AutoDetectCodePage!=0);
// �������� ������������� ��� ��� ��������������� ������ �������
if (Detect)
@@ -1531,7 +1555,7 @@
m_codepage=dwCP;
}
- if (!ignore_cached_cp && bCached)
+ if (!redetect && bCached)
{
if (pc.CodePage)
{
@@ -1548,7 +1572,7 @@
Flags.Set(FFILEEDIT_CODEPAGECHANGEDBYUSER);
}
- m_editor->SetCodePage(m_codepage); //BUGBUG
+ m_editor->SetCodePage(m_codepage, false); //BUGBUG
if (!IsUnicodeOrUtfCodePage(m_codepage))
{
@@ -2790,16 +2814,22 @@
{
if (codepage != m_codepage)
{
- m_codepage = codepage;
-
- if (m_editor)
+ if ( m_editor )
{
- if (!m_editor->SetCodePage(m_codepage))
+ if ( !m_editor->SetCodePage(codepage, true) )
{
- Message(MSG_WARNING,1,MSG(MWarning),MSG(MEditorSwitchCPWarn1),MSG(MEditorSwitchCPWarn2),MSG(MEditorSaveNotRecommended),MSG(MOk));
- BadConversion = true;
+ if (Message(MSG_WARNING,2, MSG(MEditTitle),
+ MSG(MEditorSwitchCPWarn1), MSG(MEditorSwitchCPWarn2),
+ MSG(MDoYouWantToStopWork2), MSG(MHYes), MSG(MHNo)
+ ))
+ return;
}
+ }
+ m_codepage = codepage;
+ if (m_editor)
+ {
+ BadConversion = !m_editor->SetCodePage(m_codepage, false);
ChangeEditKeyBar(); //???
}
}
Index: farlang.templ.m4
===================================================================
--- farlang.templ.m4 (revision 6296)
+++ farlang.templ.m4 (working copy)
@@ -6476,6 +6476,51 @@
upd:"Show"
"Mostrar"
+MEditorSwitchUnicodeCPDisabled
+"Нельзя изменить юникодную кодовую страницу"
+"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+upd:"Unicode codepage switch is not supported"
+
+MEditorTryReloadFile
+"Можно перечитать файл, указав нужную кодовую страницу (ShiftF4)"
+"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+upd:"You can reload file using custom codepage (ShiftF4)"
+
+MEditorSwitchToUnicodeCPDisabled
+"Переключение на юникодную кодовую страницу %d не поддерживается"
+"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+upd:"Switch to unicode codepage %d is not supported"
+
+MEditorCPNotSupported
+"Кодовая страница %d не поддерживается вашей системой"
+"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+upd:"Codepage %d is not supported in your system"
+
+MEditorCPNotDetected
+"Не удалось определить кодовую страницу"
+"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+upd:"Codepage wasn't detected"
+
MColumnName
l:
"Имя"
|
|
|
патч подвис. здесь все недокоммиченные изменения связанные с перекодировкой. новых правок я там делать пока не буду - просто в ближайщее время буду занят... |
|
|
>патч подвис Это как понимать? |
|
|
буквально. патч есть, движения нет. работает/нет : приемлемо/нет : ревью-правка текстов сообщений : модификация хэлпа -- ничего. |
|
|
Имхо движение очень даже есть, и даже более активное чем обычно ;-) Хелп за мной, да. И с моей стороны была парочка пожеланий, которые вы пока не прокомментировали. 1) О "дублировании" диалогов. В идеале объединить. Или хотя бы в новом тоже реализовать Show. 2) Об автоматической перезагрузке редактора при смене кодировки на несовместимую. Насколько реально? (В рамках отдельного тикета конечно) |
|
|
0) у меня намечается серьёзная загрука по работе, соответсвенно ~месяц я не смогу делать здесь ничего кроме незначительных правок (поэтому мне и хочется не оставлять недоделок) 1) диалоги похожи, но зовутся из разных мест, там где [Show] будет запись в файл, в другом случае Show и так будет, если не понравится - можно сделать Reload - файл не изменен. Т.е. на мой взгляд это некритично... 2) Честно говоря я не очень понимаю как вы хотите, чтобы это работало... Сделайте тикет с точным изложением хотелок - посмотрим, но позже (см. (0)) |
|
|
2607 - старый незакоммиченный патч |
|
|
Открываем файл в 1251. Shift-F8 UTF-8 Текст в кириллице молча портится. |
|
|
2613 |
|
|
Порядок. Но не хватает кнопки Show (выше уже упоминалось 0001773:0007044) |
|
|
насчёт Show - уже писал. в любом случае это к тикету 868. этот закрываю. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2011-05-18 20:07 | 2useven10 | New Issue | |
| 2011-05-18 20:07 | 2useven10 | File Added: Viewer-Codepage.diff | |
| 2011-05-18 21:15 | 2useven10 | File Added: Viewer-Codepage-2.diff | |
| 2011-05-18 21:18 | 2useven10 | Note Added: 0006898 | |
| 2011-05-19 06:27 | vskirdin | Note Added: 0006899 | |
| 2011-05-19 06:43 | 2useven10 | Note Added: 0006901 | |
| 2011-05-19 06:45 | 2useven10 | Note Edited: 0006901 | |
| 2011-05-19 06:47 | 2useven10 | Note Edited: 0006901 | |
| 2011-05-19 09:00 | vskirdin | Note Added: 0006906 | |
| 2011-05-19 09:10 | 2useven10 | Note Added: 0006909 | |
| 2011-05-19 09:24 | 2useven10 | File Added: Viewer-Codepage3.diff | |
| 2011-05-19 09:25 | 2useven10 | Note Added: 0006910 | |
| 2011-05-19 09:25 | 2useven10 | Note Edited: 0006910 | |
| 2011-05-19 09:26 | 2useven10 | Note Edited: 0006909 | |
| 2011-05-19 09:32 | 2useven10 | Note Edited: 0006909 | |
| 2011-05-19 09:34 | 2useven10 | Note Edited: 0006909 | |
| 2011-05-19 10:07 | vskirdin | Assigned To | => vskirdin |
| 2011-05-19 10:07 | vskirdin | Status | new => assigned |
| 2011-05-19 10:08 | vskirdin | Note Added: 0006915 | |
| 2011-05-19 10:08 | vskirdin | Status | assigned => feedback |
| 2011-05-19 11:43 | JohnDoe | Note Added: 0006926 | |
| 2011-05-19 11:45 | JohnDoe | Note Edited: 0006926 | |
| 2011-05-19 12:54 | 2useven10 | File Added: EditorCodepage.diff | |
| 2011-05-19 12:57 | 2useven10 | Note Added: 0006931 | |
| 2011-05-19 12:57 | 2useven10 | Status | feedback => assigned |
| 2011-05-19 13:13 | vskirdin | Note Added: 0006932 | |
| 2011-05-19 13:21 | 2useven10 | Note Added: 0006934 | |
| 2011-05-19 14:01 | vskirdin | Note Added: 0006936 | |
| 2011-05-19 14:10 | vskirdin | Note Added: 0006939 | |
| 2011-05-19 14:10 | vskirdin | Status | assigned => feedback |
| 2011-05-19 15:10 | JohnDoe | Note Added: 0006943 | |
| 2011-05-19 15:34 | JohnDoe | Note Edited: 0006943 | |
| 2011-05-23 15:18 | JohnDoe | Note Added: 0007011 | |
| 2011-05-23 15:22 | JohnDoe | Note Edited: 0007011 | |
| 2011-05-23 15:42 | JohnDoe | Note Edited: 0007011 | |
| 2011-05-23 15:43 | JohnDoe | Note Edited: 0007011 | |
| 2011-05-23 15:44 | JohnDoe | Note Edited: 0007011 | |
| 2011-05-23 15:50 | JohnDoe | Note Edited: 0007011 | |
| 2011-05-23 18:32 | 2useven10 | Note Added: 0007014 | |
| 2011-05-23 18:32 | 2useven10 | Status | feedback => assigned |
| 2011-05-23 19:45 | JohnDoe | Note Added: 0007015 | |
| 2011-05-23 19:47 | JohnDoe | Note Edited: 0007015 | |
| 2011-05-23 20:28 | JohnDoe | Note Added: 0007016 | |
| 2011-05-23 20:29 | JohnDoe | Note Edited: 0007016 | |
| 2011-05-23 20:32 | JohnDoe | Note Edited: 0007016 | |
| 2011-05-23 23:46 | 2useven10 | Note Added: 0007017 | |
| 2011-05-24 06:11 | 2useven10 | Note Edited: 0007017 | |
| 2011-05-24 06:16 | DrKnS | Note Added: 0007020 | |
| 2011-05-24 06:27 | 2useven10 | Note Added: 0007022 | |
| 2011-05-24 06:31 | 2useven10 | Note Edited: 0007022 | |
| 2011-05-24 06:46 | 2useven10 | File Added: IgnoreIncompatibleAutodetect.diff | |
| 2011-05-24 06:46 | 2useven10 | Note Added: 0007025 | |
| 2011-05-24 07:10 | 2useven10 | Note Edited: 0007025 | |
| 2011-05-24 10:54 | JohnDoe | Note Added: 0007027 | |
| 2011-05-24 10:55 | JohnDoe | Note Edited: 0007027 | |
| 2011-05-24 15:06 | 2useven10 | Note Added: 0007030 | |
| 2011-05-24 15:07 | 2useven10 | Note Edited: 0007030 | |
| 2011-05-24 15:18 | 2useven10 | Note Added: 0007031 | |
| 2011-05-24 15:19 | 2useven10 | File Added: VerboseCodepageChange.diff | |
| 2011-05-24 15:24 | 2useven10 | Note Edited: 0007031 | |
| 2011-05-25 03:58 | 2useven10 | Note Edited: 0007031 | |
| 2011-05-25 03:59 | 2useven10 | Note Edited: 0007031 | |
| 2011-05-25 04:00 | 2useven10 | Note Edited: 0007031 | |
| 2011-05-25 04:15 | 2useven10 | Note Edited: 0007031 | |
| 2011-05-25 11:23 | JohnDoe | Note Added: 0007032 | |
| 2011-05-25 12:06 | vskirdin | Note Added: 0007034 | |
| 2011-05-25 14:02 | JohnDoe | Note Added: 0007042 | |
| 2011-05-25 14:43 | JohnDoe | Note Added: 0007044 | |
| 2011-05-25 14:51 | JohnDoe | Note Added: 0007045 | |
| 2011-05-25 14:53 | JohnDoe | Note Edited: 0007045 | |
| 2011-05-25 14:56 | 2useven10 | Note Added: 0007046 | |
| 2011-05-25 15:09 | 2useven10 | Note Added: 0007048 | |
| 2011-05-25 15:29 | JohnDoe | Note Added: 0007049 | |
| 2011-05-25 15:30 | JohnDoe | Note Edited: 0007049 | |
| 2011-05-25 15:32 | JohnDoe | Note Edited: 0007049 | |
| 2011-05-25 15:35 | JohnDoe | Note Edited: 0007049 | |
| 2011-05-25 17:08 | 2useven10 | Note Added: 0007051 | |
| 2011-05-25 17:48 | JohnDoe | Note Added: 0007052 | |
| 2011-05-25 18:19 | 2useven10 | Note Added: 0007053 | |
| 2011-05-25 18:37 | 2useven10 | Note Edited: 0007053 | |
| 2011-05-25 20:32 | 2useven10 | File Added: VerboseCodepageChange2.diff | |
| 2011-05-25 20:33 | 2useven10 | Note Added: 0007056 | |
| 2011-05-26 03:49 | 2useven10 | Note Edited: 0007053 | |
| 2011-05-26 03:55 | 2useven10 | Note Edited: 0007056 | |
| 2011-05-26 09:17 | JohnDoe | Note Added: 0007060 | |
| 2011-05-26 09:35 | 2useven10 | Note Added: 0007061 | |
| 2011-05-26 10:06 | JohnDoe | Note Added: 0007062 | |
| 2011-05-27 10:46 | 2useven10 | File Added: VerboseCodepageChange3.diff | |
| 2011-05-27 10:48 | 2useven10 | Note Added: 0007093 | |
| 2011-05-27 11:31 | 2useven10 | File Added: VerboseCodepageChange4.diff | |
| 2011-05-27 11:33 | 2useven10 | Note Edited: 0007093 | |
| 2011-05-30 08:54 | 2useven10 | Note Added: 0007107 | |
| 2011-05-30 09:05 | JohnDoe | Note Added: 0007108 | |
| 2011-05-30 10:03 | 2useven10 | Note Added: 0007109 | |
| 2011-05-30 10:44 | JohnDoe | Note Added: 0007110 | |
| 2011-05-30 10:46 | JohnDoe | Note Edited: 0007110 | |
| 2011-05-30 10:47 | JohnDoe | Note Edited: 0007110 | |
| 2011-05-30 11:06 | 2useven10 | Note Added: 0007111 | |
| 2012-04-11 23:15 | 2useven10 | Note Added: 0008879 | |
| 2012-04-11 23:15 | 2useven10 | Status | assigned => feedback |
| 2012-04-13 15:07 | JohnDoe | Note Added: 0008890 | |
| 2012-04-13 15:08 | JohnDoe | Note Edited: 0008890 | |
| 2012-04-15 06:58 | 2useven10 | Note Added: 0008903 | |
| 2012-04-15 06:58 | 2useven10 | Status | feedback => assigned |
| 2012-04-15 08:09 | 2useven10 | Status | assigned => feedback |
| 2012-04-19 15:25 | JohnDoe | Note Added: 0008971 | |
| 2012-04-19 15:45 | JohnDoe | Note Edited: 0008971 | |
| 2012-04-19 19:12 | 2useven10 | Relationship added | related to 0000868 |
| 2012-05-17 10:20 | 2useven10 | Build | => 2613 |
| 2012-05-17 10:20 | 2useven10 | Note Added: 0009222 | |
| 2012-05-17 10:20 | 2useven10 | Status | feedback => assigned |
| 2012-05-17 10:20 | 2useven10 | Status | assigned => closed |
| 2012-05-17 10:20 | 2useven10 | Resolution | open => fixed |
| 2012-05-17 10:20 | 2useven10 | Fixed in Version | => 3.0 |