  ------------------------------------------------------------------------------
  
  © 2004-2007 nakamuxu
- © 2014-2016 1024jp
+ © 2014-2017 1024jp
  
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.

    /// check if can save safety with the current encoding and ask if not
    private func askSavingSafety(completionHandler: @escaping (Bool) -> Void) {
        
        let content = self.string
        let encoding = self.encoding
        

    /// change string encoding registering process to the undo manager
    @discardableResult
    func changeEncoding(to encoding: String.Encoding, withUTF8BOM: Bool, askLossy: Bool, lossy: Bool) -> Bool {
        
        assert(Thread.isMainThread)
        
        guard encoding != self.encoding || withUTF8BOM != self.hasUTF8BOM else { return true }
        
