Skip to content
Browse files

Use UTF-8 with BOM to save new documents

  • Loading branch information...
1 parent feabd33 commit ca4dee70e39d3add8b37d13cc7b0a7a52c711da9 @Infocatcher committed May 3, 2013
Showing with 9 additions and 2 deletions.
  1. +9 −2 winMergeTabs.js
View
11 winMergeTabs.js
@@ -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);

0 comments on commit ca4dee7

Please sign in to comment.
Something went wrong with that request. Please try again.