Java Editor and Unicode Characters

I'm trying to use unicode characters in strings with the Java Editor.
String myOption = "\u2666 " + myDirName;
This works nicely, displaying a diamond in my web application. Source HTML contains a &9830;
However, if I make changes in the Visual Designer (e.g., add a button), the \u2666 in my Java code changes to a diamond symbol. When that happens, I get a "?" in my web application.
How do I prevent Java Editor from switching to the display character?

Thanks for your response.
After more research, I found that the .java file is corrupted. These means the problem is not related to the browser.
When I have "\u2666" in the Java Editor window, I see "\u2666" in the .java file in Word Pad. This is properly compiled and the entity ♦ appears in the HTML.
When the diamond symbol is in the Java Editor window, I see and ascii ? (character #3F). I get a ? in the browser. It is really a question mark (#3F) not an unknown character.
So, it appears that when the JSP is changed by adding a button, the .java code is rewritten to disk but unicode characters are not translated properly. Or - something like that. If I could keep the ascii string "\u2666" from converting to the diamond, I would be all set.
I can edit the Java Code, close, save and reopen all I want and the unicode character doesn't translate to the symbol. This ONLY happens when the JSP is modified.
Any ideas?

Similar Messages

  • Do java supports all unicode characters including telugu..??

    Hello to Everybody..!
    Iam rather new to java technologies and I want to know whether java supports telugu language and if it supports it ,how can we implement it? and is there any system requirements for it.?
    Please Kindly consider this query and Thankks in advance.

    Yes, Java supports all Unicode characters. If you want to know more about Unicode, have a look at its website:
    http://www.unicode.org/
    Telugu characters are in their code charts here:
    http://www.unicode.org/charts/PDF/U0C00.pdf
    You don't have to "implement" anything. System requirements would include a font that can render those characters. I don't know about keyboards.

  • KeyPressed and unicode characters

    Is there anyone that can explain me why no keyPressed / keyReleased events are generated, but only keyTyped, when I press unicode characters as :
    � � � � � � � � � �
    The "Alt Gr" key doesn't generated any kind of event too.
    You can experiment it with the KeyEventDemo.java source in the Java tutorial.
    I'm using an italian keyboard on java 1.5 / linux fc2
    Thanks in advance

    If you're still looking for info, this may help.
    (From the KeyEvent JavaDoc, http://java.sun.com/j2se/1.4.2/docs/api/java/awt/event/KeyEvent.html)
    "Key typed" events are higher-level and generally do not depend on the platform or keyboard layout. They are generated when a Unicode character is entered, and are the preferred way to find out about character input. In the simplest case, a key typed event is produced by a single key press (e.g., 'a'). Often, however, characters are produced by series of key presses (e.g., 'shift' + 'a'), and the mapping from key pressed events to key typed events may be many-to-one or many-to-many. Key releases are not usually necessary to generate a key typed event, but there are some cases where the key typed event is not generated until a key is released (e.g., entering ASCII sequences via the Alt-Numpad method in Windows). No key typed events are generated for keys that don't generate Unicode characters (e.g., action keys, modifier keys, etc.). The getKeyChar method always returns a valid Unicode character or CHAR_UNDEFINED. For key pressed and key released events, the getKeyCode method returns the event's keyCode. For key typed events, the getKeyCode method always returns VK_UNDEFINED.
    "Key pressed" and "key released" events are lower-level and depend on the platform and keyboard layout. They are generated whenever a key is pressed or released, and are the only way to find out about keys that don't generate character input (e.g., action keys, modifier keys, etc.). The key being pressed or released is indicated by the getKeyCode method, which returns a virtual key code.

  • Java, Oracle, and Arabic Characters

    Hi,
    I need to run some Forms fmb files that contain Arabic characters through Oracle's forms to xml converter (frmf2xml.bat). The XML that is generated by the utility contains strings such as "رقم الموظ�" instead of the Arabic characters I was expecting.
    The XML output by frmf2xml.bat is encoded as UTF-8.
    My NLS_LANG is set to AMERICAN_AMERICA.UTF8. The characters display fine in Forms Builder.
    Is there another localization setting I need to make with the conversion utility or even with Java itself?
    Any insight or comments appreciated.
    Dave

    On a related note, I am seeing a couple of different types of 'incorrect' characters based on different NLS_LANG settings.
    If it is set to AMERICAN_AMERICA.UTF8, I get characters like this:
    رقم الموظ�
    If it is set to ARABIC_UNITED ARAB EMIRATES.AR8MSWIN1256, I get characters like this:
    ÑÞã ÇáãæÙÝ
    Do any of you know what these characters are?
    Thanks for any insight.

  • Java editor - set the number of spaces displayed for tabs

    How do I tell Studio Creator to use tabs instead of spaces?
    I open Tools - Options - Editing - Java Editor and set
    Code Formatting Rule = Java Indentation Engine ...
    - Expand Tabs to Spaces = false
    - Number of Spaces per Indent = 4
    - Statement Continuation Indent = 4
    After reformatting the source every 8 spaces were replaced by 1 tab. The blocks look like (s = space, t = tab)
    ssss{
    t       {
    t       ssss{I want to have every 4 spaces replaced by 1 tab and displayed 4 characters per tab.

    How do I tell Studio Creator to use tabs instead of spaces?
    I open Tools - Options - Editing - Java Editor and set
    Code Formatting Rule = Java Indentation Engine ...
    - Expand Tabs to Spaces = false
    - Number of Spaces per Indent = 4
    - Statement Continuation Indent = 4
    After reformatting the source every 8 spaces were replaced by 1 tab. The blocks look like (s = space, t = tab)
    ssss{
    t       {
    t       ssss{I want to have every 4 spaces replaced by 1 tab and displayed 4 characters per tab.

  • Using Runtime exec() method to run java files and return runtime errors

    Hi
    I'm writing a java editor and I use
    Runtime.getRuntime().exec(command)
    to compile the java files. That works fine and I deal with the returned errors using the getErrorStream().
    My questions are:
    1. Can I use the same technique for returning runtime errors. In any posts I've read the process runs from begining to end, returning the errors after completion. How do I return the errors of the app as they happen interactively?
    2. If i cant use the exec and getErrorStream() methods then does anyone know how it is done?
    Thanks in advance for any help!

    Read this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    MOD

  • Problem when using Ctr-Z in Java editor

    If I create a component in the Desgin view, the switch to Java Editor and uze Cancel (or Ctrl+Z), it cancle the op�ration, ie remove the code added when the component was created. The component is also removed in Design view. However, it is stil present in the JSP code. Under deployment, it produces an error. The stacktrace says the error is about a component which is not present in the design view, wich is a bit confusing.

    Looks like a bug.
    To fix just remove the jsp tag for the component

  • Up for something new in Java - tabs and executables.

    Hey again,
    Ive grown quite confident in my basics for JAVA and now want to try some new things.
    I want to make a piece of java that i could actually open like somekind of program, preferably (like) a .exe file,
    Are you aware of any way to acomplish this?
    Next to that, I want to use tabs in the new application, but how does the tab structure work?
    I am using Java-Editor and am interested in the JTabbedPane part, to be more exact.
    Thanks in advance!
    -Annihlator.

    Annihlator wrote:
    Hey again,
    Ive grown quite confident in my basics for JAVA and now want to try some new things.
    I want to make a piece of java that i could actually open like somekind of program, preferably (like) a .exe file,
    Are you aware of any way to acomplish this?
    Next to that, I want to use tabs in the new application, but how does the tab structure work?
    I am using Java-Editor and am interested in the JTabbedPane part, to be more exact.
    Thanks in advance!
    -Annihlator.The preferred distribution format for java is the .jar (Java ARchive)file. If they are built correctly and the .jar file type is linked to the java runtime, they can be double-clicked and executed. Sun has some very nice tutorials on building and using them.
    As for JTabbedPane, it's really quite simple. Just add the JPanels you want to show for each tab to the JTabbedPane (along with the tab text). Again, the tutorials (linked from the javadocs) explain the basics pretty well.

  • Help,DataInputStream and Unicode encoding problem

    Hello,everybody
    I am writing a small software for fun,but an problem about Unicode encoding stopped me. I tried to parse a file including integers,floats and Unicode characters(not UTF-8 but some other encoding type). I looked for the JDK documentation and I found that the class DataInputStream( implementing the interface DataInput) fitted my requirement best, then I tried but the Unicode characters are not read correctly( messy codes,only '????????').
    would you please help me? thanks a lot :-)

    the class DataInputStream has the methods useful to me, but find there is no method to set the encoding format ,both in DataInputStream and argument types used in its constructor:
    FileInputStream fis=new FileInputStream(fileName);
    DataInputStream     dis=new DataInputStream(fis);
    String line =dis.readLine();               System.out.println(line);
    // only "????????" output as result :-(
    I wonder how to set the encoding type,or another class.
    if I do it this way,it works,but there is no methods such as "readFloat","readInt",etc, so it's not what I want :
    FileInputStream fis=new FileInputStream(fileName);
    InputStreamReader read=new InputStreamReader(fis,"GB2312");
    BufferedReader reader=new BufferedReader(read);
    DataInputStream     dis=new DataInputStream(fis);
    String line = reader.readLine();
    System.out.println(line);
    thank you for your repley!

  • How do I get unicode characters out of an oracle.xdb.XMLType in Java?

    The subject says it all. Something that should be simple and error free. Here's the code...
    String xml = new String("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<x>\u2026</x>\n");
    XMLType xmlType = new XMLType(conn, xml);
    conn is an oci8 connection.
    How do I get the original string back out of xmlType? I've tried xmlType.getClobVal() and xmlType.getString() but these change my \u2026 to 191 (question mark). I've tried xmlType.getBlobVal(CharacterSet.UNICODE_2_CHARSET).getBytes() (and substituted CharacterSet.UNICODE_2_CHARSET with a number of different CharacterSet values), but while the unicode characters are encoded correctly the blob returned has two bytes cut off the end for every unicode character contained in the original string.
    I just need one method that actually works.
    I'm using Oracle release 11.1.0.7.0. I'd mention NLS_LANG and file.encoding, but I'm setting the PrintStream I'm using for output explicitly to UTF-8 so these shouldn't, I think, have any bearing on the question.
    Thanks for your time.
    Stryder, aka Ralph

    I created analogic test case, and executed it with DB 11.1.0.7 (Linux x86), which seems to work fine.
    Please refer to the execution procedure below:
    * I used AL32UTF8 database.
    1. Create simple test case by executing the following SQL script from SQL*Plus:
    connect / as sysdba
    create user testxml identified by testxml;
    grant connect, resource to testxml;
    connect testxml/testxml
    create table testtab (xml xmltype) ;
    insert into testtab values (xmltype('<?xml version="1.0" encoding="UTF-8"?>'||chr(10)||'<x>'||unistr('\2026')||'</x>'||chr(10)));
    -- chr(10) is a linefeed code.
    commit;
    2. Create QueryXMLType.java as follows:
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import oracle.xdb.XMLType;
    import java.util.*;
    public class QueryXMLType
         public static void main(String[] args) throws Exception, SQLException
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              OracleConnection conn = (OracleConnection) DriverManager.getConnection("jdbc:oracle:oci8:@localhost:1521:orcl", "testxml", "testxml");
              OraclePreparedStatement stmt = (OraclePreparedStatement)conn.prepareStatement("select xml from testtab");
              ResultSet rs = stmt.executeQuery();
              OracleResultSet orset = (OracleResultSet) rs;
              while (rs.next())
                   XMLType xml = XMLType.createXML(orset.getOPAQUE(1));
                   System.out.println(xml.getStringVal());
              rs.close();
              stmt.close();
    3. Compile QueryXMLType.java and execute QueryXMLType.class as follows:
    export PATH=$ORACLE_HOME/jdk/bin:$PATH
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export CLASSPATH=.:$ORACLE_HOME/jdbc/lib/ojdbc5.jar:$ORACLE_HOME/jlib/orai18n.jar:$ORACLE_HOME/rdbms/jlib/xdb.jar:$ORACLE_HOME/lib/xmlparserv2.jar
    javac QueryXMLType.java
    java QueryXMLType
    -> Then you will see U+2026 character (horizontal ellipsis) is properly output.
    My Java code came from "Oracle XML DB Developer's Guide 11g Release 1 (11.1) Part Number B28369-04" with some modification of:
    - Example 14-1 XMLType Java: Using JDBC to Query an XMLType Table
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb11jav.htm#i1033914
    and
    - Example 18-23 Using XQuery with JDBC
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb_xquery.htm#CBAEEJDE

  • The JSP WYSIWYG Editor can't display most Unicode characters

    Eclipse supports display of Unicode characters very well since version 3. However, NitroX couldn't display most most of them. Well, besides characters from other non-Western European languages, NitroX can't even display characters that it's supposed to support. Well, that's what I think so. I mean, when we type the & character, we have the whole list of character entity references amongst which we could find &and; &nabla; &or; &rarr; but which are not displayed correctly. And many more are in this case.
    Is this a feature or a bug? By "feature", it means that we can't get them in free version.

    I have exactly the same problem. I support web pages for 25 European countries. I've not seen Nitrox support any unicode characters. Until M7 answers this question or fixes the editor, you can use the Eclipse editor to see and edit the text.

  • Terminal.app and the European Unicode characters?

    Does anyone have the unicode characters working properly in Terminal.app?
    If I try to write in GNU nano 1.2.4 for instance "örrör" it translates into:
    (one empty line)
    örr
    ör
    which isn't certainly right. This is especially awkward when editing an unicode text file where the text then easily becomes more or less garbled. Usually more.
    It doesn't seem to make any difference whether or not I use the Finnish extended (unicode) keyboard layout or the conventional one in nano. If the Terminal.app window preferences are set as UTF-8, it says:
    ?rr
    ?r
    which looks even more garbled.
    In plain bash the characters print like this:
    å = \345
    ä = \344
    ö = \366
    so my mighty apple translates the example string "örrör" as "\366rr\366r".
    Any ideas, anyone?
    PowerBook G4 @ 1.5 GHz   Mac OS X (10.4.4)   1.25 GB DDR SDRAM
    Debian Sarge 3.1 as a slave fetchmail server.

    Hi solarflare,
       My first (and essentially only) language is English as well. However enough folks have asked that I have experimented with multibyte characters. There are so many apps and options involved, it's difficult to get consistent results. However, I'll recount as many settings as I can recall.
       To begin with, you are right about the LC settings. It helps many apps to have:
    export LCALL=enUS.UTF-8
    export LANG=en_US.UTF-8
    set in your shell startup scripts. Then the system should be set to produce unicode when you type. In the "Input Menu" tab of the "International" pane of "System Preferences", you should select a unicode keyboard layout, such as U.S. Extended.
       To configure the Terminal, you need to open the "Terminal Inspector" by selecting "Window Settings..." in the "Terminal" menu. To type many multibyte characters, you need the option key. To use it, you must have the "Use option key as meta key" checkbox unchecked, although I find the meta key too important in UNIX to leave that unchecked. In the dropdown menu in the "Display" pane of the "Terminal Inspector", you should set the "Character Set Encoding" to "Unicode (UTF-8)". In the "Emulation" pane of the same window, you must uncheck the "Escape non-ASCII characters" checkbox. That is important as I've read that it is checked by default and that can produce some pretty strange results.
       Now it's helpful to use a very modern shell. For instance, the latest beta version of zsh-4.3 has the best unicode support of all versions of zsh. After you've chosen a good shell, you're at the mercy of the application that you're using. As I gather you've noticed, vim has excellent unicode support and picks up on the LC settings. I have no idea about nano but it is meant to be a minimal text editor.
       I know that my settings allow me to type extended characters and the "Character Palette" lets me insert more. As far as other command line utilities go, the best you can do is to choose well and keep your apps as up-to-date as possible. Fink or Darwin Ports can often help in that regard.
    Gary
    ~~~~
       This generation doesn't have emotional baggage.
       We have emotional moving vans.
             -- Bruce Feirstein

  • Java class names which contain unicode characters

    I need to create, compile and load java classes which have class names that contain unicode characters.
    I am using Win2k but will neet to support unix* in future.
    When I try to create a fooXbar.jar where X is a unicode character which is not ascii I get an error when creating the file.
    My question is: how do I map java class names and package names which contain non ascii characters into
    names that the files systems will like AND that the java VM will use when trying to load .class file from the class path.
    for example what would the .java and .class file be for the following class?
    class \u6587\u66f8 {

    You could make names for .java and .class that is understandable by the filesystem. E.g. you could prepend with % and then digits for the unicode character. The problem is then how to compile the class, and how to load the class.
    You can load the class with a custom classloader, which will translate the unicode class name to the escaped file name (using %).
    The problem is then reduced to how you can compile your code (you have to map the file name to the class name somehow). I think it can be done, but I don't know the solution to that.
    Alternatively you can use meaningful names for the classes, and then make an obfuscator that can change the bytecodes so the classnames are changed to some obscure unicode names. Perhaps there is already obfuscators out there you can use that will use unicode characters.

  • Java, International language, Unicode, Chinese or accented characters

    Hi, I've posted a message in the new to forum but think that this is more of an advanced problem.
    Sorry for duplication.
    I am having trouble getting java to output Strings that contain unicode characters out of the normal ascii set. This includes accented letters and chinese characters.
    Example code:
    String jintian = "??"
    System.out.println(jintian) ;(The string jintian should refer to two chinese characters. I'm having trouble getting these to appear properly here, you may see ??.)
    Basically if I run this code the output I get is ??. Questionmarks in place of the chinese characters.
    There is either a problem here with Java or with my Shell but I don't know how to troubleshoot this.
    I can tell you that my shell is able to display chinese characters, but with the ls command I have to use a flag. -v. I have tried using this -v flag with the java command but it is rejected.
    One more thing, when compiling I am using the -encoding=UTF-8 flag.
    I have the line ...
    export LANG=en_UK.UTF-8... in my bash profile.
    Any ideas, I would be really grateful.
    Message was edited by:
    stanton_ian
    Message was edited by:
    stanton_ian
    In case anyone is interested in trying this themselves and doesn't know how to put in the Chinese characters here is a link to a pre-written very simple Class. http://freespace.virgin.net/i.stanton/NiHao.html .
    You will need to save the file in utf8 encoding and compile it with the -encoding UTF-8 flag.

    Between jdk1.2 and jdk 1.3 the default encoding of the vm changed.
    You can get it by executing:
    System.out.println("Default Encoding:" + System.getProperty("file.encoding"));
    or
    System.out.println("Default Encoding:" + (new java.io.InputStreamReader(System.in)).getEncoding());
    The default encoding is used during the conversion of bytes to strings and vice verca.
    Assume your default encoding is ISO8859_1. Then calling new String(byte[]) is equivalent to calling
    new String(byte[], "ISO8859_1")
    Now if you are converting a character from one encoding scheme to another and there is no mapping
    for this character in the target scheme. Then the character will be replaced by a default character
    which is (quite often) the question mark.
    You can set the default encoding for a vm by passing it as a command line parameter
    java -Dfile.encoding=ISO8859_1
    java -Dfile.encoding=Cp1252

  • Printing unicode characters in Java - help

    Hi there,
    I want to print out unicode characters through java programming language in windows system. For example, I want to print Devanagari characters. I found out that '\u0900' to '\u0975' represent devanagari characters. So I tried following,
    out = new PrintStream(System.out, true, "UTF-8");
    out.println('\u0911');
    but they print characters like ��� and not the actual devanagari characters. Just to be more clear, devanagari script is used by Hindi, Nepali and similar languages.
    If you knew about it and could give any suggestions, that would be very helpful.
    Thanks in advance!

    priyankabhar wrote:
    I am not sure, it is just a windows system and I am trying to print to the command line. Please suggest me how I can find out if my console supports it.Use the CHCP command to find out what code page your console uses. And as already suggested, Google is a good resource if you don't know what a "code page" is.

Maybe you are looking for

  • Can't install iTunes on Windows 7 - error code 2329

    I just installed Windows 7 on my computer and now am trying to re-install iTunes...I uninstalled it before upgrading from Vista to 7 because a compativbility scan said that iTunes could cause problems with the installation of Windows 7 Now, after sav

  • Error message please help/ virus?

    sorry! the appplication phone (process.com.android.phone) has stopped unexpectantly. please try again how do i reset phone? i think the app tturbo droid is a virus, i tried uninstalling this and the error message wont stop popping up.. what should i

  • Clearing of Vendor Open Item

    Dear all, After I have done MIGO and MIRO for the PO. May I kown how to clear the Vendor Open Item found in F.41? Thank you.

  • Monitor bandwidth utilization for Hyper-V's Virtual Machines

    Hi, I'm wondering, if SCOM is capable to monitor incoming & outgoing traffic (current and total over time) of VMs in Hyper-V? Tried to search about it, and found only 3rd party tools or the monitoring is only available for Router, not VMs. Thanks.

  • FTP server on XI

    Hi All, I have an FTP server on XI. I receve files from other third party systems int this FTP Directory. I need to pickup those file from this FTP. Which transport protocol that I have to use for this? thanks in advance Kartikeya