69

is there a way to set Windows 7 to globally use UTF-8 as standard?
its really annoying to set every single text editor to use it.

3
  • 4
    So you want to tell the OS something .. and then magically all editors pick that up? :) How many editors do you use? Every 3 minutes another one? Anyway: superuser.com/questions/221593/windows-7-utf-8-and-unicode From what I know: Windows uses UTF16 internally everywhere, and I doubt that you can change that.
    – akira
    Jan 31, 2011 at 7:09
  • 1
    editors i use: notepad, notepad++, qt, eclipse, thunderbird, open office, and some others... i am not just talking about plain text editors but everything that works with text in and output. most of the platform independent text editors use utf-8 as standard in Linux but use Latin-1 in Windows.
    – Baarn
    Feb 1, 2011 at 15:36
  • Not on Windows 7 but it's possible on Windows 10
    – phuclv
    Jun 22, 2019 at 10:44

2 Answers 2

50

The short answer is no, it is not possible.

To elaborate, I am afraid you won't find a global encoding option in Windows 7 that lets you both 1) set a global default which 2) all the applications you listed would obey.

Also, I would like to ask what is the problem here that you are trying to solve?

It is up to the application to choose whether they use unicode internally to represent data. While use of unicode is encouraged, you may never be sure that all your applications in fact do internally support it.

What you can do, however is change the default character encoding for each of the listed applications:

  • For Eclipse, default encoding for new files can be set from Windows > Preferences > General > Content Types (see post on Eclipse Community Forms)
  • For Notepad++, navigate to Settings > Preferences > New Document/Default/Directory and set Encoding to UTF-8
  • As for Thunderbird, I am pretty sure it already uses UTF-8 as the default encoding? (see these notes about character encoding)
  • In the case of OpenOffice (and LibreOffice), you actually don't even need to care about encoding, since documents saved by OpenOffice are based on XML, in which encoding is specified internally in the XML-files (and UTF-8 is already the default there as well)
  • From UTF-8 point-of-view, PowerShell is tricky. It has default encoding of UTF-16LE.
    • For outputting files from PowerShell to UTF-8, see this answer
    • For changing default encoding see this answer
2
  • 4
    not the answer i was hoping to get but i think i have to live with the truth, thank you =)
    – Baarn
    Feb 2, 2011 at 21:33
  • for notepad windows ?
    – Mimouni
    Oct 12, 2016 at 16:39
24

It's not possible mainly because Windows does not allow UTF-8 as the system ANSI codepage even though it does have an ANSI codepage for UTF-8, codepage 65001. There seem to be several reasons for this:

  • When Unicode was new Microsoft decided UCS-2 would be the best way to support Unicode. At that time Unicode was 16-bit.
  • Windows has one ANSI codepage for each supported language, unlike Unix and Linux where the language and encoding can be set independently.
  • Code page 65001 doesn't work everywhere. Specifically it is broken with some of the MultiByte support in Windows which expect multibyte characters to require one or two bytes whereas UTF-8 requires between one and four bytes. The WriteFile() API for instance returns an incorrect result under codepage 65001 which bubbles up through all library code relying on it such as write().

The late Michael Kaplan who worked on internationalization at Microsoft had a blog, "Sorting it all Out", with several posts on related topics. I emailed him directly about some of these concerns back in the day.

2
  • Note that back when Windows (NT) was conceived, there was no UTF-8. So UCS-2 was actually a really sane choice (and impossible to change afterwards, except to UTF-16).
    – Joey
    Jan 11, 2017 at 8:59
  • 3
    The reason is because UTF-8 locale might break some functions (a possible example is _mbsrev) as they were written to assume multibyte encodings used no more than 2 bytes per character, thus until now code pages with more bytes such as GB 18030 (cp54936) and UTF-8 could not be set as the locale.. But at least now it's possible to set UTF-8 locale on Windows 10
    – phuclv
    Jun 22, 2019 at 10:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .