Skip to content

Commit

Permalink
Use UTF-8 with BOM to save new documents
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed May 2, 2013
1 parent feabd33 commit ca4dee7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions winMergeTabs.js
Expand Up @@ -201,8 +201,15 @@ function getFile(lpFrame) {
AkelPad.Command(4105); // IDM_FILE_SAVE
else {
var tempFile = file = getTempFile(hWndEdit, origFile);
var codePage = AkelPad.GetEditCodePage(hWndEdit);
var hasBOM = AkelPad.GetEditBOM(hWndEdit);
if(origFile) {
var codePage = AkelPad.GetEditCodePage(hWndEdit);
var hasBOM = AkelPad.GetEditBOM(hWndEdit);
}
else {
// Will use UTF-8 with BOM to correctly save all (most?) new documents
var codePage = 65001;
var hasBOM = 1;
}
var text = AkelPad.GetTextRange(0, -1);

AkelPad.SendMessage(hMainWnd, 273 /*WM_COMMAND*/, 4101 /*IDM_FILE_NEW*/, 0);
Expand Down

0 comments on commit ca4dee7

Please sign in to comment.