Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

javac says

If the -encoding option is not specified, then the platform default converter is used.

I guess the default encoding in Linux is UTF-8, how to get the default encoding in Linux?

share|improve this question

javac will use the default encoding with which it has been configured. Often this corresponds to whatever your system's default locale "codeset" happens to be, but there actually is no guarantee that they are the same. The JVM does not pay attention to the locale environment variables.

The term "codeset" is (almost) synonymous with "charset set" or "encoding".

Further reading:

share|improve this answer

Not sure if that's what you're asking, but you can see your encodings by running locale. Example:

malice@Haskell ~ $ locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=
share|improve this answer
    
Technically, locale does not show the encoding, but the encoding-name is by convention part of the locale settings. – Thomas Dickey Dec 24 '15 at 12:41

on ubuntu 14 , you can use this quick command:

    # env |grep LANG
share|improve this answer
    
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. - From Review – PersianGulf Dec 25 '15 at 0:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.