Go Back   Velocity Reviews > Newsgroups > Java
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply

Java - default encoding of a jvm

 
Thread Tools Search this Thread
Old 07-15-2003, 12:53 PM   #1
Kihup Boo
 
Posts: n/a
Default default encoding of a jvm

how can i get the default encoding value of a jvm or a system?

- Ki


  Reply With Quote
Old 07-15-2003, 03:15 PM   #2
Joseph Millar
 
Posts: n/a
Default Re: default encoding of a jvm

On Tue, 15 Jul 2003 08:53:06 -0400, "Kihup Boo" <> wrote:
> how can i get the default encoding value of a jvm or a system?


System.getProperty("file.encoding");

On my XP system, it yields "Cp1252", on my Linux box it's "UTF-8".
Based on your language and region, you will get different values
(maybe).

--Joe
  Reply With Quote
Old 07-15-2003, 07:10 PM   #3
Roedy Green
 
Posts: n/a
Default Re: default encoding of a jvm

On Tue, 15 Jul 2003 08:53:06 -0400, "Kihup Boo" <>
wrote or quoted :

>how can i get the default encoding value of a jvm or a system?


see http://mindprod.com/jgloss/encoding.html
hint: it is not DEFAULT !!!


--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
  Reply With Quote
Old 07-17-2003, 12:06 PM   #4
X_AWieminer_X
 
Posts: n/a
Default Re: default encoding of a jvm

>>how can i get the default encoding value of a jvm or a system?
>
> see http://mindprod.com/jgloss/encoding.html
> hint: it is not DEFAULT !!!


This little trick should tell you the JVM-OS default encoding. More
transparent implementation would use a os-generated temporary file and
then delete it. Most likely utility class with a static value would
create a temp file on first method invocation and then reuse that value.

I dont know whether we could use FileReader to achieve the same encoding
value.

private String getDefaultCharSet() throws IOException {
FileWriter filewriter = new FileWriter("out");
String encname = filewriter.getEncoding();
filewriter.close();
return encname;
}

  Reply With Quote
Old 07-22-2003, 01:54 AM   #5
Roedy Green
 
Posts: n/a
Default Re: default encoding of a jvm

On Tue, 15 Jul 2003 08:53:06 -0400, "Kihup Boo" <>
wrote or quoted :

>how can i get the default encoding value of a jvm or a system?


check out Wassup which displays the system properties. Every but he
kitchen sink is in there somewhere.

http://mindprod.com/wassup.html

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
DVDSHRINK encoding question Jørn Jensen DVD Video 3 12-21-2005 09:49 AM
Computer with default language in Chinese AG A+ Certification 3 04-03-2005 11:40 PM
ProCoder 2 DVD tutorial with Ben Waggoner... DSL.net News DVD Video 1 09-17-2004 05:30 AM
The story behind DIVX encoding? Opticreep DVD Video 1 05-23-2004 02:25 AM
Re: Default media player natural_4u A+ Certification 1 02-16-2004 08:35 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47