Author Topic: [SOLVED] Set encoding on new window without saving  (Read 2790 times)

tmb

  • Community Member
  • Posts: 13
  • Hero Points: 0
[SOLVED] Set encoding on new window without saving
« on: February 28, 2014, 10:18:49 AM »
I have a shortcut to quickly open a new window (new-file) without doing any settings. When pasting text into the window from Visual Studio some unicode characters gets whacked. I guess the window defaults to automatic encoding and it fails to detect the unicode paste correctly.

Is there a way to set the encoding on a window before associating it to a file type, ie essentially what i want is a shortcut that would emulate File->New..., selecting Plain Text and Encoding: UTF-8.
« Last Edit: February 28, 2014, 11:41:12 PM by tmb »

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Set encoding on new window without saving
« Reply #1 on: February 28, 2014, 09:32:25 PM »
The "Encoding" topic in the Help has a lot of related info, maybe that can help.
The help for "e" has a bunch of related info as well.

What does your shortcut do?
Maybe this is what you're looking for?
Code: [Select]
   e("+FUTF8");

tmb

  • Community Member
  • Posts: 13
  • Hero Points: 0
Re: Set encoding on new window without saving
« Reply #2 on: February 28, 2014, 11:31:30 PM »
Thanks for the tip on e.

Ctrl-t just runs 'new-file' command. Nothing else. Look like i might have to write a macro then so i can open the new window and then set the encoding on it.

tmb

  • Community Member
  • Posts: 13
  • Hero Points: 0
Re: Set encoding on new window without saving
« Reply #3 on: February 28, 2014, 11:40:18 PM »
I solved it: Recorded a macro doing new->select plain text->utf8 encoding. Saved it and bound it to ctrl-t. Just tested it and it works.