Jichao
Jichao

Reputation: 41845

Which Unicode encoding does the Linux kernel use?

I have learned that Windows uses UTF-16LE on x86/x64 systems. What about Linux? Which Unicode encoding does it use: UTF-16LE or UTF-32?

Upvotes: 3

Views: 6050

Answers (2)

Mike Samuel
Mike Samuel

Reputation: 120546

http://www.xsquawkbox.net/xpsdk/mediawiki/Unicode says

Linux

On Linux, UTF8 is the 'native' encoding for all strings, and is the format accepted by system routines like fopen().

so Linux is like Plan 9 in that respect, and boost::filesystem and Unicode under Linux and Windows notes

It looks to me like boost::filesystem under Linux does not provide a wide character string in path::native(), despite boost::filesystem::path having been initialized with a wide string.

which would rule out UTF-16 and UTF-32 since all variants of those require wide character support -- NUL bytes allowed inside strings.

Upvotes: 4

MK.
MK.

Reputation: 34587

Generally Unix prefers UTF-8. This document suggests that Linux kernel does too.

Upvotes: 3

Related Questions