File.encoding = Cp1252

Dear List,
I have noticed in my system.properties that my windows xp 1.4 jdk has
file.encoding = Cp1252
What does this mean generally ? In my jsp web application, I have noticed that the jsp pages themselves which have html company headers have been corrupted somewhat, e.g. copyright symbol becomes something else (looks like utf8!). Could this be something to do with it ? Does this mean that text stream IO readers etc will adopt this encoding as default
what affects can it have if I change this using the setProperty method?
regards
Ben

Setting with
java -Dfile.encoding= works.
public class a {
     public static void main(String a[] ) {
          System.out.println(System.getProperty("file.encoding") + " \u0150\u0151\u0170\u0171");
}D:\doku\source\colors\src\web>java a
Cp1252 ????
D:\doku\source\colors\src\web>java -Dfile.encoding=utf8 a
utf8 ┼�┼�┼░┼▒
D:\doku\source\colors\src\web>java -Dfile.encoding=latin2 a
latin2 ╒⌡█√

Similar Messages

  • How can a convert a file encoded Cp1252 (Windows Latin-1) to text file.

    please this is urgent
    could some one tell me how I can a convert a file encoded Cp1252 (Windows Latin-1) to a text file.

    I need to convert a file encoded in Cp1252
    (well that is what I get as when I invoke the method
    in.getEncoding())to a plain text file a readable format... (UTF8 format?? )so I that i can parse it with StringTokenizer...
    sorry for some missing part of the first message.
    thanks

  • File encoding cp1252 problem

    Hi there,
    I have a problem concerning the file encoding in a web application.
    I'll sketch the problem for you.
    I'm working on adjustments and bug fixes of an e-mail archive at the company i work for. With this archive, users can search e-mails using a Struts 1.0 / JSP web application, read them, and send them back to their mail inbox.
    Recently a bug has appeared, concerning character sets.
    We have mails with french characters or other uncommon characters in it.
    Like the following mail:
    Subject: Test E-mail archief co�rdinatie Els
    Content: Test co�rdinatie r�d�marrage ... test weird characters � � �
    In the web application itself, everything is fine...but when i send this mail back to my inbox, the subject gets all messed up:
    =?ANSI_X3.4-1968?Q?EMAILARCHIVE_*20060419007419*_Tes?=
    =?ANSI_X3.4-1968?Q?t_E-maill_archief_co=3Frdinatie_Els?=
    The content appears to be fine.
    We discovered this problem recently, and a lot of effort and searching has been done to solve it.
    Our solution was to put the following line in catalina.sh , with what our Tomcat 4.1 webserver starts.
    CATALINA_OPTS="-server -Dfile.encoding=cp1252"
    On my Local Win2K computer, the encoding didn't pose a problem, so catalina.sh wasn't changed. It was only a problem (during testing) on our Linux test server ... a VMWare server which is a copy of our production environment.
    On the VMWare, i added the line to the catalina.sh file. And it worked fine.
    Problem Solved !
    Yesterday, we were putting the archive in production. On our production server ... BANG --> NullPointerException.
    We thought it has something to do with jars he couldn't find, older jars, cache of tomcat ... but none of this solved the problem.
    We put the old version back into production, but the same NullPointerException occured.
    We then put the "CATALINA_OPTS="-server -Dfile.encoding=cp1252" " line in comment ... and then it worked again.
    We put the new version into production (without the file encoding line), and it worked perfectly, except for those weird ANSI characters.
    Anyone have any experience with this?
    I use that same file encoding to start a batch, but there i call it Cp1252 (with a capital C) ... might that be the problem? But i have to be sure...because the problem doesn't occur in the test environment, and i can't just test in production ... and switch off the server whenever i'd like to.
    Does anyone see if making cp1252 --> Cp1252 might be a solution, or does anyone have another solution?
    Thanks in advance.

    First, I will start by saying that JInitiator was not intended to run on Win7, especially 64bit. So, it may be time to think about moving to the Java Plugin. Preferably one which is certified with your Forms version.
    To your issue, I suspect you need to change the "Region and Language" settings on the client machine. This can be found on the Control Panel. If that doesn't help, take a look at this:
    http://stackoverflow.com/questions/4850557/convert-string-from-codepage-1252-to-1250

  • How to set File Encoding to UTF-8 On Save action in JDeveloper 11G R2?

    Hello,
    I am facing issue when I am modifying a File using JDeveloper 11G R2. JDeveloper is changing the Encoding of the File to System default Encoding (ANSI) instead of UTF-8. I have updated the Encoding to UTF-8 in "Tools | Preferences | Environment | Encoding" option and restarted the JDeveloper. I have also updated "Project Properties | Compiler | Character Encoding" option to UTF-8. None of them are working.
    I am using below version of JDeveloper,
    Oracle JDeveloper 11g Release 2 11.1.2.3.0
    Studio Edition Version 11.1.2.3.0
    Product Version: 11.1.2.3.39.62.76.1
    I created a file in UTF-8 Encoding. I opened it, do some changes and Save it.
    When I open the "Properties" tab using "Help | About" Menu, I can see that the Properties of JDeveloper are showing encoding as Cp1252. Is it related?
    Properties
    sun.jnu.encoding
    Cp1252
    file.encoding
    Cp1252
    Any idea how to make sure JDeveloper saves the File in UTF-8 always?
    - Sujay

    I have already done that. That is the first thing I did as mentioned in my Thread. I have also added below 2 options in jdev.conf and restarted JDeveloper, but that also did not work.
    AddVMOption -Dfile.encoding=UTF-8
    AddVMOption -Dsun.jnu.encoding=UTF-8
    - Sujay

  • Jinitiator 1.3.1.2.6 on win 7 64 and win xp (different file.encoding)

    Hello,
    our customer has moved from windows XP to Windows 7 and he uses Jinitiator 1.3.1.2.6...
    In some "Forms" I have implemented a PJC to save datas from clob to local file system..
    But there is a problem....
    If I run the same application with Windows XP I get file.encoding=Cp1250 which is ok....
    If I run the same application with Windows 7 (64) I get file.encoding=CP1252 and here is the problem...
    Is there any way to run Jinitiator (or set up file.encoding to/with) Cp1250?
    Maybe is this a local problem with windows?
    thank you..

    First, I will start by saying that JInitiator was not intended to run on Win7, especially 64bit. So, it may be time to think about moving to the Java Plugin. Preferably one which is certified with your Forms version.
    To your issue, I suspect you need to change the "Region and Language" settings on the client machine. This can be found on the Control Panel. If that doesn't help, take a look at this:
    http://stackoverflow.com/questions/4850557/convert-string-from-codepage-1252-to-1250

  • File.encoding in windows influence  by the locale

    How can I set the file.encoding in windows platform that will not be influence by the locale.
    For example, in the Control Panel->Regional Options the locale is set to Russian
    and what I get is that I use file.encoding Cp1251 even though I pass the parameter in the command line
    -Dfile.encoding=Cp1252 (I want to keep Cp1251,
    Cp1251 is US westen default and Cp1252 is Windows Cyrillic)
    I run java program to see what encoding I use
    D:\ProgramFiles\jdk1.3.1\bin\java -Dfile.encoding= Cp1252 TestEncodingThe locale in my pc is Russian and the result is:
    System.getProperty("file.encoding") == Cp1252
    Default ByteToChar Class == sun.io.ByteToCharCp1251
    Default CharToByte Class == sun.io.CharToByteCp1251
    Default CharacterEncoding == Cp1251
    OutputStreamWriter encoding == Cp1251
    InputStreamReader encoding == Cp1251
    TestEncoding.java
    import java.io.PrintStream;
    import java.io.ByteArrayOutputStream;
    import java.io.OutputStreamWriter;
    import java.io.InputStream;
    import java.io.ByteArrayInputStream;
    import java.io.InputStreamReader;
    class TestEncoding{
    public static void main(String[] args) {
    String encProperty = System.getProperty("file.encoding");
    System.out.println("System.getProperty(\"file.encoding\") == " + encProperty);
    String byteToCharClass = sun.io.ByteToCharConverter.getDefault().getClass().getName();
    System.out.println("Default ByteToChar Class == " + byteToCharClass);
    String charToByteClass = sun.io.CharToByteConverter.getDefault().getClass().getName();
    System.out.println("Default CharToByte Class == " + charToByteClass);
    String defaultCharset = sun.io.ByteToCharConverter.getDefault().getCharacterEncoding();
    System.out.println("Default CharacterEncoding == " + defaultCharset);
    ByteArrayOutputStream buf = new ByteArrayOutputStream(10);
    OutputStreamWriter writer = new OutputStreamWriter(buf);
    System.out.println("OutputStreamWriter encoding == " + writer.getEncoding());
    byte[] byteArray = new byte[10];
    InputStream inputStream = new ByteArrayInputStream(byteArray);
    InputStreamReader reader = new InputStreamReader(inputStream);
    System.out.println("InputStreamReader encoding == " + reader.getEncoding());

    What are you really trying to accomplish? Applications should avoid relying on undocumented or implementation dependent features, such as the file.encoding property and sun.* classes (see http://java.sun.com/products/jdk/faq/faq-sun-packages.html).
    On the other hand, there's plenty of documented public API that lets you work with specific character encodings. For example, you can specify the character encoding for conversion between byte arrays and String objects (see the String class specification) or when reading or writing files (see the InputStreamReader and OutputStreamWriter classes in java.io).
    The default encoding is needed by the Java runtime when accessing the Windows file system, for example file names, so changing it would likely result in erroneous behavior.
    Norbert Lindenberg

  • Problem with file.encoding system property

    Hi all
    I develop a web application with Tomcat app server.
    I have to set file.encoding system property to "Cp1252", but when I set it programatically using System.setProperty("file.encoding","Cp1252") it doesnt affect to my program outcome but when I put it in catalina.bat with set JAVA_OPTS=-Dfile.encoding=Cp1252 it works fine.
    what is the differences and why I cant change that property programatically?
    thanks

    why I cant change that property programatically?It is a system property reflecting the initial settings read when the JVM started. Resetting the system property java.home will not change your home directory either.

  • Problem with file.encoding in Linux

    Hello,
    I am currently migrating a java project from Windows to Linux. The project is finally shaping up now, except for some encoding problems.
    All configuration files are saved in ISO-8859-1/Cp1252 format. When reading and displaying these files in Swing (e.g. JTextArea), the special characters ���� are displayed wrong. I have tried to start the VM with -Dfile.encoding=ISO-8859-1 and -Dfile.encoding=Cp1252 without success (this is done in Eclipse under Linux).
    I then tried the opposite. I created some UTF-8 files, started the application under Windows/Eclipse, read the files and displayed them in a JTextArea. Garbage characters were shown instead of ���� (as expected). I then used -Dfile.encoding=UTF-8, and voila, all characters were displayed correctly.
    Why does not -Dfile.encoding work for ISO-8859-1/Linux but -Dfile.encoding work for UTF-8/Windows? Anyone here know?
    The JRE I have been using is 1.4.2_06.
    The Linux is a SuSE 10.0

    Continue the "discussion" here:
    http://forum.java.sun.com/thread.jspa?threadID=737153

  • File.encoding won't swap

    trying to help someone who has a windows file server originally installed for russian locale. they managed to swap it back to what they require (en_GB) but the JVM file encoding's still stuck on cp1251. they say they've changed the JVM config's file encoding ("-Dfile.encoding=cp1252") yet the system still reports cp1251 for the file encoding (even after several reboots). i don't see anything in the bug parade & i'm at a loss as to why this box won't swap it's JVM file encoding.
    any ideas?
    thanks.

    which version of the videoencoder are you using?
    2.0.0.494 edition (Brand New)
    Remember that you can't crop all files at once . .
    Oh, didn't see that in the manual!
    Where the heck is it listed?
    I tried to save a profile with the compression setting -
    including cropping - but upon trying to use that saved profile - a
    dialog box comes up with:
    Warning: some of the settings (crop, trim, cue point . . . .
    Too bad, so sad!
    2,000+ movies is gonna take a long time!
    Their huge files - broadcast DVC-Pro - and the overscan - and
    interlace top & bottom show up . . . . Aaarrrgggg!
    Bye the way - is it 4 pixels cropped - top & bottom - to
    clean it up ?
    And shouldn't a few (maybe 2 pixels) on each side be cropped
    as well?
    Any other suggestions on how to automate what I need to do
    (deinterlace, crop 4 pixels top & bottom & 2 pixels sides -
    exported "High Quality / large)
    Thanks for responding so far - sure helps clarify things!
    Luke

  • Unable to set JVM file encoding to UTF-8 on Windows

    Hi,
    I am running Tomcat on 1.5.0_05 JRE. I tried several things to set the jvm file encoding to UTF-8 instead of the default Cp1252, but no luck yet.
    The most intuitive approach seems to be to use a JVM option like
    "-Dfile.encoding=UTF-8"
    but this does not seem to have any effect. I have a WinXP pro m/c. I saw some bug reports which seemed to indicate that changing the JVM file encoding is not an available feature....is that correct? I would really appreciate any help/pointers on this. I will post the solution if I find something in the meantime.
    Thanks,
    Sriram

    I am fail to set it too. I think it is better to separate the file.encoding into two, one for accept local OS, the other for compile .java and .jsp and so on files. So we can change it and the bugs will be decrease!

  • How to set the file.encoding in jvm?

    I have some error in showing Chinese by used servlet,
    some one tole me that I can change the file.encoding in jvm to zh_CN, how can I do that?

    Add the java argument in your servlet engine.
    e.g
    java -Dfile.encoding=ISO8859-1
    garycafe

  • File encoding in sender file comunication channel

    hello everyboy,
    i have a strange situation.
    2 PI 7.0 installation: develop and production. Identical. Same SP level, java vm, etc etc
    I have a interface file to idoc.
    File sender comunication channel are FTP and with content conversion.
    They are identical!!!!!!
    but....
    in production i added parameter File Encoding = ISO-8859-1 because if i have presence of strange characters....it work better.
    the same files...in develop installation, they work without this parameter.
    why?
    there are a place maybe in Config Tool or j2ee admin tool where is set this parameter?
    thanks in advance
    Edited by: apederiva on Mar 12, 2010 3:55 PM

    Hi,
    Make sure your both the systems are unicode so that you will not have any issues. Also please see this document for how to work with character encodings in PI. Also we dont have any special config in j2ee admin tool.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42?quicklink=index&overridelayout=true
    Regards,
    ---Satish

  • HOW SPECIFY FILE.ENCODING=ANSI FORMAT IN J2SE ADAPTER.

    Hi All,
    we are using j2se plain adapter,   we need the outputdata in ANSI FORMAT.
    Default file.encoding=UTF-8
    how to achive this.
    thanks in advance.
    Regards,
    Mohamed Asif KP

    File adapter would behave in a similar fashion on J2ee. Providing u the link to ongoing discussion
    is ANSI ENCODING possible using file/j2see adapter
    Regards,
    Prateek

  • Text File Encoding used by TextEdit/OS X

    Hi all folks,
    does someone know the code page are used with the text file encoding "Western (EBCDIC US)"
    available from the "Customize Encodings List" in the TextEdit "Plain Text File Encoding" Preferences.
    The text file encoding "Western (EBCDIC Latin 1)" works well, but "EBCDIC US" does not,
    the character set is very limited.
    Thanks for any help,
    Lutz

    Yeah unfortunately they're all listed as 0kb files. I guess that means the faulty hard drive didn't transfer them properly, even though the Mac did the copy confirmation sound.
    Hundreds of folio files... all gone. ;___;

  • XI File Adapter Custom File Encoding for  issues between SJIS and CP932

    Dear SAP Forum,
    Has anybody found a solution for the difference between the JVM (IANA) SJIS and MS SJIS implementation ?
    When users enter characters in SAPGUI, the MS SJIS implementation is used, but when the XI file adapter writes SJIS, the JVM SJIS implementation is used, which causes issues for 7 characters:
    1. FULLWIDTH TILDE/EFBD9E                 8160     ~     〜     
    2. PARALLEL TO/E288A5                          8161     ∥     ‖     
    3. FULLWIDTH HYPHEN-MINUS/EFBC8D     817C     -     −     
    4. FULLWIDTH CENT SIGN/EFBFA0             8191     ¢     \u00A2     
    5. FULLWIDTH POUND SIGN/EFBFA1            8192     £     \u00A3     
    6. FULLWIDTH NOT SIGN/EFBFA2              81CA     ¬     \u00AC     
    7. REVERSE SOLIDUS                             815F     \     \u005C
    The following line of code can solve the problem (either in an individual mapping or in a module)
    String sOUT = myString.replace(\u0027~\u0027,\u0027〜\u0027).replace(\u0027∥\u0027,\u0027‖\u0027).replace(\u0027-\u0027,\u0027−\u0027).replace(\u0027¢\u0027,\u0027\u00A2\u0027).replace(\u0027£\u0027,\u0027\u00A3\u0027).replace(\u0027¬\u0027,\u0027\u00AC\u0027);
    But I would prefer to add a custome Character set to the file encoding. Has anybody tried this ?

    Dear SAP Forum,
    Has anybody found a solution for the difference between the JVM (IANA) SJIS and MS SJIS implementation ?
    When users enter characters in SAPGUI, the MS SJIS implementation is used, but when the XI file adapter writes SJIS, the JVM SJIS implementation is used, which causes issues for 7 characters:
    1. FULLWIDTH TILDE/EFBD9E                 8160     ~     〜     
    2. PARALLEL TO/E288A5                          8161     ∥     ‖     
    3. FULLWIDTH HYPHEN-MINUS/EFBC8D     817C     -     −     
    4. FULLWIDTH CENT SIGN/EFBFA0             8191     ¢     \u00A2     
    5. FULLWIDTH POUND SIGN/EFBFA1            8192     £     \u00A3     
    6. FULLWIDTH NOT SIGN/EFBFA2              81CA     ¬     \u00AC     
    7. REVERSE SOLIDUS                             815F     \     \u005C
    The following line of code can solve the problem (either in an individual mapping or in a module)
    String sOUT = myString.replace(\u0027~\u0027,\u0027〜\u0027).replace(\u0027∥\u0027,\u0027‖\u0027).replace(\u0027-\u0027,\u0027−\u0027).replace(\u0027¢\u0027,\u0027\u00A2\u0027).replace(\u0027£\u0027,\u0027\u00A3\u0027).replace(\u0027¬\u0027,\u0027\u00AC\u0027);
    But I would prefer to add a custome Character set to the file encoding. Has anybody tried this ?

Maybe you are looking for

  • Extremely Slow USB 3.0 Speeds When Transferring Large Amounts of Video

    Hi there, I am transferring large amounts of footage (250GB-1.75TB chunks) from 5x 5400rpm 2TB drives to 5x 7200rpm 2TB drives simultaneously (via 6x USB 3.0 connections and 4x SATA III, with copy/paste in explorer) and the transfer speeds are incred

  • FaceTime: Knowing how much traffic

    Hi, Today I used for the first time FaceTime, and it is very impressive. Good image quality and without any problems. I used it with my mum, who lives at more than 2000km from me. Cool and free!!! (great jog Apple people!!) So what I would like to kn

  • Computation based on the drilling of a time hierarchy

    Hi, I have a cube with two dimensions A, B and two measures C, D. B is a date and I have values for each day of year. I have a classic time hierarchy Year->Quarter->Month->Day for B and A has also some other hierarchy. The report shows A, B where the

  • Creating a document that is 468x60...HELP!

    Hi there I wan to create a document size of 468 x 60 as I want to create a flash banner advert. When i'm typing in the custom size, it it dosn't let me create this size! Does anyone know how to bypass this? Thanks for your help, Mark

  • System.out.println in gui--- question

    Hello People. First of all, I'm new to the forums, so if it doesn't belong here, plese tell me where to post questions like this. The Problem: I have a GUI and another class,which contains the Program. Here's the code of my class: int Battle(String C