0

Is it possible to know with System.getParameter is the installed JRE is internationalized or not?

Andrew

user592704
  • 3,674
  • 11
  • 70
  • 107
  • 2
    what do you mean by internationalized? – Bozho Apr 13 '11 at 21:59
  • 1
    Since you added the tag 'character-encoding' do you mean if the JRE is set to use unicode? Note that Java internally always uses unicode and can output text in almost any encoding you want out of the box. – Thomas Apr 13 '11 at 22:09
  • I have installed JRE on linux and I need the JRE to support cyrillic utf-8 encoding to write txt files content with my servlet and keep it on the linux. But I am not sure is it possible because for some reason the servlet cannot get client cyrillic headers etc so I need to know is it enough just to set the Locale and get result with the JRE I have installed. So I need to know is it the internationalized or not. So can I see it with System.getParameter or something in this way? – user592704 Apr 13 '11 at 22:22
  • To be more detailed I have most the same problem as the thread describes http://stackoverflow.com/questions/3072376/how-can-i-open-files-containing-accents-in-java but I just need to use Locale("ru","") and keep file names in txt file but the problem is the same :( – user592704 Apr 13 '11 at 22:24
  • So did you check the answers there, e.g. the `-Dfile.encoding=UTF-8` suggestion? – Thomas Apr 13 '11 at 22:34
  • That's why I need to know maybe it is all because of the OpenJDK or because the jre is not internationalized – user592704 Apr 13 '11 at 22:36
  • quote: "So did you check the answers there, e.g. the -Dfile.encoding=UTF-8 suggestion?" yes I have checked it and I want to say that the linux file.encoding is utf-8 by default. The problem is I am trying to write cyrillic file names to linux txt file. the file names come from my client and the client file.encoding is cp1251. on my client I encode the file names to utf-8 and send them to my linux servlet and there I try to write them right to linux txt file but the problem becomes when I am trying to parse the txt content back to my client – user592704 Apr 13 '11 at 22:43
  • ... I need to parse the file names to let my client app choose which file to download (I send file name to my linux servlet to download the file but linux servlet says "file does not exist" so it cannot write it back to client) – user592704 Apr 13 '11 at 22:48
  • Given there is no `System.getParameter()` method, I think it is safe to say that 'no - it is not (existing or) internationalized'. – Andrew Thompson Apr 13 '11 at 22:50
  • I mean I want to write file names to linux txt file to parse them back to client to have a point what uploaded file user wants to download. On client file name was created with windows cp1251 encoding. client app uploads the file to linux server and writes its name to linux txt file to make possible download it back by its name but this encoding problem is a real badluck :( – user592704 Apr 13 '11 at 22:52
  • Well actually I know there are two jre types. The us one it is for EN lang only and the international one which supports many languages. So I just thought maybe I get all these problems just because I have the EN based JRE? How to know that? – user592704 Apr 13 '11 at 23:00

1 Answers1

1

As far as I know, the difference between the english-only JRE and the internationalized only concerns the availability of Locale-specific data, used for example for TimeZone, Calendar, NumberFormat, DateFormat, message strings and such.

This should have no influence on the character encodings used for your files.

Paŭlo Ebermann
  • 73,284
  • 20
  • 146
  • 210
  • That is good news I guess :) But why I cannot write utf-8 files content and file names on linux? I mean client strings are unclear to read locally :( – user592704 Apr 14 '11 at 03:09
  • Your problem is not really clear. Show code (add it to the question, or make a new question). Best thing to do would be to create a [SSCCE](http://sscce.org). – Paŭlo Ebermann Apr 14 '11 at 11:24