Default Java Charset

Hello:
I have a problem sending mail from a web application; when it's run from my desktop it sends mail OK, but when it's run from the server it sends messages with accents ant other signs garbled (in the body and in the Subject line).
I've been investigating and saw that the difference between the same message sent from the two machines is that one is encoded with "quoted-printable" when the other is "7bit". After more investigations I think I compose the mail correctly, but then I used "MimeUtility.getDefaultJavaCharset()" and discovered that my machine gets "ISO-8859-15" while the server gets "US-ASCII". Both are linux machines, and they have the "es_ES@euro" locale set. I've discarded too the encoding of the text file from which I get the text of the body, because I test always with three files (they have the same content, but one is encoded in UTF8, other in ISO-8859-1 and the other in ISO-8859-15).
So the problem seems to me that is reading the file; if JVM in the server runs in US-ASCII meybe it can't read the file correctly, so it won't get correctly encoded in the mail no matter what I do.
The question is: How can I change the Java Default Charset in the server? Or, how can I read the file correctly no matter what the Java Default Charset is?
Thank you in advance.

Well, at least I can send now the text correctly encoded, although it now encodes it with "base64" instead of "quoted-printable", which is what I intended... Anyway, here's the code I use to read the text file forcing the charset:
BufferedReader lectorFichero=new BufferedReader(new InputStreamReader(new FileInputStream(nombreFichero),"ISO-8859-15"));
StringBuffer bufferTextoFichero=new StringBuffer();
int i;
while((i=lectorFichero.read())!=-1) bufferTextoFichero.append((char)i);
lectorFichero.close();
String textoFichero=bufferTextoFichero.toString();(Thanks to Dr. Heinz M. Kabutz; http://www.roseindia.net/javatutorials/using_unicode_variable_names.shtml)

Similar Messages

  • How to change the default database charset to ISO8859-1?

    Hi all,
    I have created a table with a nvarchar field to store string, may i now how to change the default NLS charset to ISO88591 charset?
    Thanks in advance.
    chin.

    Thank you!
    I will try later!
    But,who can tell me more detail !
    thx

  • Help - I cannot set the Default Java for Browsers

    Hello:
    I'm running Win 7, the Home Premium, 64 bit flavor. I have IE 8 and FF 3.5.8 installed. FF is the default browser. I've installed Java and when I go to the test page: http://www.java.com/en/download/help/testvm.xml
    I get a message which says: "Something is wrong. Java is not working."
    HOWEVER, if I open a command prompt and type java -version, I get this:
    C:\Users\dogzilla>java -version
    java version "1.6.0_17"
    Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
    Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode)
    So I went to the control panel app, the advanced tab, and expanded the node for Default Java for Browsers. I have 2 problems.
    1. The checkbox for Microsoft Internet Explorer is greyed out; I cannot change any settings here at all.
    2. I checked the checkbox for Mozilla Family. Then, when I click OK, I get an error message which states:
    "Unable to change browser settings. Please check that Mozilla or Firefox or Netscape is properly installed on the system and/or that you have sufficient permissions to change system settings."
    Since I'm writing this message to the forum using FF, I'm going to guess that I have the browser installed correctly. So that leaves me with a permissions problem -- which I don't doubt. I have no idea where to start looking though. Especially considering I can run the files in the bin directory from a command line without any problems.
    Does anyone know how I can solve the two problems I described in this thread? Suggestions are greatly appreciated.
    Thanks!

    Thanks for the reply!
    I tried running as admin and no luck. Still experiencing the same problems.
    I've did some more reading (much more in fact for what this problem should be worth) and other forums mention that on 64 bit Windows systems, both the 32 bit and 64 bit JRE need to be installed.
    When I was running Win XP, I could just download the SDK, create an environment variable, and I was good to go. Now, it looks like if I just install the SDK, I need the JRE plugin download for just the browsers -- what a ridiculous waste/duplication!
    Thanks again for your help.

  • This is regarding CBMA in SAP PI 7.3.1. I have set up the alert mail using default java mail client.I do receive the alerts via mail. But my requirement is to direct all the mails to Business workplace inbox in ECC.

    This is regarding CBMA in single stack SAP PI 7.3.1. I have set up the alert mail using default java mail client.I do receive the alerts via mail. But my requirement is to direct all the alert mails to Business workplace inbox in ECC.
    So I need to set up PI to redirect mails to ECC Business workplace user inbox (sbwp). From here rules are set up & routed per distribution list.
    Please guide me how I can achieve this requirement.

    Hi,
    yes, it is a little bit different. This is the issue.....  
    But I am not sure if your links will help:
    1) /people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable
    is about a different solution. I do not need to count the number of lines of the source message.
    And the second variable is about concat line by line from unbound node to unbound node.
    My issue is:
    Souce:
    Message line (0...unbound) ! ! ! ! ! ! ! !
    .    ResultLine   (1..1)
    Mapping:
    =>   ResultLine1
           ResultLine2
           ResultLine........          => into UDF to an element  (1..1) in one mapping operation.
    So that all "ResultLine"s are included.
    The result is explained in the given link for Mail attachment with UDF.
    So I am not sure how to use this thread for my issue.
    In the comments of that blog Christoph Gerber writes that the new variable feature can only handle single values.
    So it is not suitable for my purposes as I have a list of values here that needs to be moved into the target message field.
    2) http://wiki.sdn.sap.com/wiki/display/Java/UsingEditJavaSectioninMessageMapping
    shows where to find the button "Java section" which is not available here in 7.1
    3) /people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
    too is about the nice little button for Java Section that is no longer existing on PI 7.1 screen for mappings.  
    So my issue is: How to replace the Java section function with global variables in PI 7.1?
    Best regards
    Dirk

  • Websites that use java are not working. In the Java control panel, under advanced, default java for browsers "mozilla family" won't stay clicked

    I've recently gotten a new Windows 8 computer. Ever since, I've tried accessing certain websites (like www.cnet.com) and can't get the java scripts to load like for the drop down menus. When I hover over them they don't do anything. Other computers I have that run Windows 7 are working just fine.
    I've upgraded Firefox and Java to all of the newest versions but it's still not working. When I go to the Java control panel, under "Advanced" and under "Default Java for browsers", the check box next to "Mozilla family" won't stay checked. I'll check it, click "Apply" and "Ok" and then when I open it back up it's unchecked again.
    Help.

    cor-el -
    The dom.w3c_touch_events.enabled was already set to 0.
    I don't have a "dom.w3c_touch_events.expose" line. Is that something I should?

  • Default java / jsp file which gets executed before DAM asset rendering

    Hi,
    I have a requirement to implement access control on DAM assets on the basis of a metadata property (tags).
    Is there a default JAVA / JSP file which gets executed before rendering a DAM asset?
    If yes, how can I override it?
    If no, how can I add a new JSP / JAVA file to be executed before rendering of each DAM asset?
    Thanks in advance,
    Anurag

    Hello Anuran,
    I dont think there is any api which is executed when you rendering any DAM asset on page component because for each type of DAM asset there are different APIs available which you use the render those dam asset like "Image" class to render the image asset.
    Each dam asset also support having different rendition format and if you are interested in that then refer http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/dam/api/DamEvent.Type.html
    Please let me know if you need more information
    Thanks,
    Pawan

  • Script Default Java for browsers

    Hello all,
    I would like to know if is it possible to script the enabling of "Default Java for browsers". http://www.java.com/en/download/help/5000021500.xml
    We have a large deployment of the JRE currently 1.6.0-05, we would like to run a script for all users to make sure that IE is enabled within the control panel for Java.
    I have been unable to find a successful registry setting or file setting to enable this for all users. It appears that the setting is only enabled if done manually through the Java control panel.
    Does anyone know how this can be scripted to enable for all users, we would like to do this on login through kix or group policy.
    thanks for your help.

    In Internet Explorer, go to Tools -> Manage Add-Ons and scroll down to Sun Java Plug-In.
    db

  • How to set JRE 1.5.0_07 as default Java from the cmd line in Windows

    Hi All,
    We are currently in the process of upgrading our company to IE8. As MS JVM is incompatible we need to remove it.
    However, once we have done this JRE 1.5.0_07 is not the default version of Java any more for IE8.
    My question is - Is there a command line switch to set set JRE 1.5.0_07 as default Java from the cmd line in Windows. ie the setting in Java Control panel where you would tick Internet Explorer?
    Thanks in advance!

    This is to confirm a similar issue. Here is the scenario:
    We are currently using IE 6 and looking forward to upgrade to IE 8. Our current Java version is: J2RE 1.5.0_16.
    When updating from IE 6 to IE 8 with J2RE 1.5.0_16 on a test workstation, we get the following error from the Java testing website (http://www.java.com/en/download/help/testvm.xml): "load: class testvm2/Main.class not found."
    Workaround :
    -> Change Java JRE Network Settings in Control Panel to "User proxy server : xxx.xxx.xxx.xxx:xx"
    We are using an autoconfig.pac file and it seems IE8 can't parse the settings to JRE to go through the proxy.
    Please advise if you have a fix for the autoconfig.pac file.

  • Upgrade default java version in Solaris 8?

    I have Solaris 5.8 running on sun blade system. Default Java version is 1.2.2 and user need it to upgraded to latest version of Java so, I installed jre1.6.0 (combination of 32-bit install and 64 bit install). Now I can't point solaris to look at the newly installed java version. I have tried to change the path variable in .cshrc but it is readonly to root and group is deamon. I also tried changing the symbolic link from /usr/java to /usr/jre1.6.0 but it is still looking at default version of java1.2.2.
    I need help as I don't know much about Solaris to upgrade this java. Any help or guidance is greatly appreciated.
    Thanks,
    solaris_newbee

    After installing, you need to update the '/usr/java' sym link to point to your new root installation. For example, I installed jdk1_5_16 at /usr/jdk/jdk1.5.0_16/ and then added this symlink:
    ln -s /usr/jdk/jdk1.5.0_16/ /usr/java
    You may need to remove the symlink that is already there before it will allow you to successfully create the new one.
    There are several other dependent symlinks in /usr/bin that use /usr/java, but you only have to update /usr/java.
    From one noob to another.

  • Change "Default Java for browsers"

    Hi everyone,
    I am using Java 6 standard edition, update 15 in Windows 7 professional 64 bit. For some reasons, I need to change value in Java Control Panel->Advance->Default Java for browsers which sets to Microsoft Internet Explorer. But I can't because it appears in disable state (The checkbox looks grey).
    See picture at http://bit.ly/9JQumJ
    Please help me.
    Thanks in advance.
    Edited by: tujthevux on Oct 16, 2010 3:56 PM

    In Internet Explorer, go to Tools -> Manage Add-Ons and scroll down to Sun Java Plug-In.
    db

  • Can't set default java for Mozilla in java control panel

    OK. It was fine before installation of SE 6u5. Now Sun java works ok in IE7 but not in Firefox 2.0.0.8. THe problem is obviously in the java control panel that sun java is set as default java for MS IE, but not Mozilla. Here is my question:
    I used to be able to tick BOTH IE and Mozilla. But now, when I tick Mozilla, it accepts but after I click yes to close the control panel and open it again, the tick i just made disappears. (So, it means not accepted as a default java) I did make new installation of Firefox for other reasons. Could it be that something has been messed up by both installations. I have tried to remove the deployment.properties and install JRE 1.6.0_5 again while Firefox is already there, but in vein. Thre is another problem that may be related. I can't use the installer downloaded from the internet. I have to use the installer available in the Documents and Settings\administrator\application data\sun\java\jre1.6.0_05 to install jre1.6.0_5.
    Environment: Windows XP pro SP2 with up-to-date Windows updates. Sun java installed: JRE 1.4.2_17, JRE1.6.0_5, and JDK 1.5.0_15.
    I need help to know what can I do to make sun java woking with my Firefox again.... Another question: can i uninstall the JRE 1.4.2_17 since I have now JRE 1.6.0_5?
    Thanks in anticipation.

    You cannot set a default value for this attribute, because by default Identity Sync sets useraccountcontrol to 512.
    You can find this default value in the configuration registry (under the ou=services tree on your configuration directory server) and change it to 514. Make sure you restart the Identity Sync services after you update the value.
    Bertold

  • Default Java runtime

    Hi there
    in my project setup, I currently have defined two JRE entries.
    Both of them show up in the Java Preferences installed JREs,
    however, no matter what I do, it's always the 32-bit JRE that gets set as default.
    Can I force the 64-bit JDK to be the default Java runtime for the workspace?
    Cheers
    Jörg

    Jörg,
    Perhaps it's always the last (or first) to perform, that's made the default?
    On 24/07/2015 4:26 PM, Joerg Buchberger wrote:
    > Hi there
    >
    > in my project setup, I currently have defined two JRE entries.
    > Both of them show up in the Java Preferences installed JREs,
    > however, no matter what I do, it's always the 32-bit JRE that gets set
    > as default.
    >
    > Can I force the 64-bit JDK to be the default Java runtime for the
    > workspace?
    >
    > Cheers
    > Jörg
    >

  • How to change the java control panel and the default java in windows.

    Hi,
    Please help on the above problem. I need the answer urgently.
    I have two java version 1.4 and 1.5. I first installed the java version 1.4.2_06 and then 1.5.0_19.Now the default java is 1.5.
    Now I want to chang the java settings to 1.4 by changing the envioronment variable (classpath,path,java_home)
    C:\Program Files\Java\jdk1.5.0_09;C:\j2sdk1.4.2_06
    C:\Program Files\Java\jdk1.5.0_09\lib;C:\j2sdk1.4.2_06\bin
    C:\Program Files\Java\jdk1.5.0_09\bin;C:\j2sdk1.4.2_06\bin
    But after setting these does not solve the problem. The java control panel which appears is the same what was appearing for java 1.5.
    I want to see the control panel for 1.4.2_06.
    Thanks for your help.
    Regards,
    Sarita

    sarita2320 wrote:
    ..Please help on the above problem. I need the answer urgently. ...Is it still urgent?
    When I opened your post and saw that line, I immediately moved it to the 'last in line' of a whole bunch of other stuff I did not have time to look at immediately. Now that all that other stuff that did not bore me with someone else's time constraints is out of the way/taken care of, I've returned to your post.

  • Bug - Default Java version

    When I'm changing the default java version in the Default Project Properties to 1.5.0_05-b05 and creating a new project; the new project still has java version 1.5.0_05 (Default).
    Bug?
    /Per-Arne

    I have just made the test of setting JDK 1.5.0_04 as the default version of Java and when I created a new project it worked perfectly. The change was made by downloading JDK 5 update 4 from Sun; making it accessible to JDeveloper by defining a new J2SE Definition in JDeveloper (from Default Project Properties) and selecting it as the default version of Java.
    Please note that even though 1.5.0_05-b05 was not selected by default, it was selectable for the new project, so it's not a big deal, but I still think that it must be a bug under the hood that should be corrected.
    The reason that I tried to change the default Java version was that Sun's version was 1.5.0_05-b05 and JDeveloper's was "only" 1.5.0_05-b03. ;-)

  • Setting forte as default java editor

    ok I know this is a stupid question...but how do you configure forte to be your default java editor after it has already been installed on you machine?

    If you are using Windows, go to MyComputer->Tools->Folder Options->File Types and associate .java files with Forte. The exact way to do this varies with Windows versions. You should be able to get help on it.

Maybe you are looking for