Retrieving Unicode characters with MS Query

Hi.
I am using MS Query to retrieve data into Excel from an Oracle database.  The data contains several different characters (such as degree and diameter symbols) which are stored as Unicode, but the query returns the same character for all of them.
In the MS Query window the special characters appear as upside down question marks; in Excel they show as white question marks in a black diamond.  The ASCII code of the character displayed in Excel is '63', and the UNICODE() value is 65533.  This
isn't the character that is stored in the Oracle database.
Is there a way to correctly retrieve these characters? 
The ODBC driver is Oracle in OraClient11g_home1, version 11.02.00.01.  I've tried it with the 'Force SQL_WCHAR Support' setting on, but it didn't make a difference.  So, I've pretty much exhausted my knowledge now...
Thanks in advance,  Steve

Hi
Steve,
As far as I know the function of MS Query didn’t update anymore after the version of excel 2003. I suppose the issue might be caused by the different rules between Unicode
and ASCII code, so you get different result in excel from Oracle database. I suggest you can try to use PowerQuery and PowerPivot. Their function are stronger than MS Query, and you can get latest function. Probably they can help you to solve your issue.
Hope it’s helpful.
Regards,

Similar Messages

  • ### Problem in retrieving special characters with Oracle 9i JDBC drivers

    hi,
    We are having some problem with retrieving special characters like '�' from the database.
    Our application is using JDK1.3.1 with Oracle 9i at the back end(Version: 9.0.1.0.0). We are using oracle 9i thin drivers (classes12.zip) for database interaction.
    To relieve the data from database we are using PreparedStatement in two ways
    1. Creating a preparedstatement from connection object without any parameters and then retrieve the
    data using it. This gives the results in correct format i.e. special characters like '�'
    2. Create the preparedstatement by passing the following parameters.
    i) ResultSet.TYPE_SCROLL_INSENSITIVE
    ii) ResultSet.CONCUR_READ_ONLY
    In this case we are not able to retrieve the special character like '�' correctly. Instead the ResultSet
    returns 'h'
    I think this is the problem with Oracle drivers. Does anyone have any information about the mentioned problem.
    rgds

    I don't know exactly (because I am using JDK 1.4 with ojdbc14.jar where these problems seem to be rare...) but you may consider this:
    1. Add nls_charset12.zip to your classpath to ensure that the encoders are present (may or may not help)
    2. Swith to JDK 1.4, and do this:
    Instead of String s = getString(column)
    use
    byte[] bytes = getBytes(column);
    ByteBuffer bb = ByteBuffer.wrap(bytes); // in package java.nio
    CharBuffer cb = Charset.forname("ISO-8859-x").decode(bb);
    String s = cb.toString();
    The latter method allows you to perform the encoding/decoding manually.
    3. Change the character encoding in the database to unicode upon database setup.
    4. Try playing with NLS parameters (alter session ...)

  • How to use Unicode characters with TestStand?

    I'm trying to implement the use of Greek characters such as mu and omega for units. I enabled multi-byte support in the station options and attempted to paste some characters in. I was able to paste the mu character (μ) and import it from Excel with PropertyLoader. However, I have not had any luck with omega (Ω). I found the HTML codes for these characters on a web page (http://www.hclrss.demon.co.uk/unicode/) so I could use those codes for HTML reports, but that won't work for database logging, nor does it display the characters correctly for the operator interface. The operator interface is not a major problem, but the database must have the correct characters for customer reports. Anyone know how to do this? D
    oes database logging support Unicode for stored procedure calls to Oracle?

    Hello Mark -
    At this time TestStand has no unicode support. The multi-byte support that we do offer is based on the Windows architecture that handles Asian language fonts. It really isn't meant to provide a bridge for unicode values in TestStand. Certainly, your Operator Interface environment will have its own support level for unicode, i.e. at this time neither LabWindows/CVI version 6.0 nor LabVIEW 6.1 officially support unicode characters. This is why you will see that the units defined in the TestStand enumerators are all text-based values.
    I have run a quick test here, probably similar to what you were doing on your end, and I am uncertain if you will get the database behavior you want from TestStand. The database logging steps and API all use basic char sty
    le strings to communicate to the driver. Even though you are reading in a good value from Excel, TestStand is interpreting the character as the nearest ASCII equivalent, i.e. "Ω" will be stored and sent to the database as "O". If you have a stored proceedure in Oracle that is calling on some TestStand variable or property string as an input, then it is doubtful you will get correct transmission of the values to the database. If your stored proceedure could call into a spreadsheet directly, you would probably have better luck.
    Regards,
    Elaine R.
    National Instruments
    http://www.ni.com/ask

  • Problems reading unicode characters with BufferedReader or PrintWriter

    I am creating a pretty standard chat server and client with the exception that I want to be able to send special math symbols back and forth to aid in helping people with math homework. The unicode characters will appear on the buttons, in the textField (where users type in their messages), in the messageArea (where users see all of the messages) correctly. However, as soon as the server reads it, it is converted to a ? character by either the BufferedReader or the PrintWriter, but I am fairly certain it is the BufferedReader. All of the Sun examples I have read recommend doing exactly what I have done to be able to support unicode characters so I am somewhat at a loss. Any help would be appreciated. I will include all of the source code (which is rather large) but the main problem is the with the BufferedReader or PrintWriter when the servers reads the string in and then broadcasts it to all the clients (at least I'm pretty sure it is).
    // ChatServer.java
    import java.net.Socket;
    import java.net.ServerSocket;
    import java.io.InputStreamReader;
    import java.io.BufferedReader;
    import java.io.PrintWriter;
    import java.io.IOException;
    import java.util.Set;
    import java.util.HashSet;
    import java.util.HashMap;
    import java.util.Iterator;
    * A multithreaded chat room server. When a client connects the
    * server requests a screen name by sending the client the
    * text "SUBMITNAME", and keeps requesting a name until
    * a unique one is received. After a client submits a unique
    * name, the server acknowledges with "NAMEACCEPTED". Then
    * all messages from that client will be broadcast to all other
    * clients that have submitted a unique screen name. The
    * broadcast messages are prefixed with "MESSAGE ".
    * Because this is just a teaching example to illustrate a simple
    * chat server, there are a few features that have been left out.
    * Two are very useful and belong in production code:
    * 1. The protocol should be enhanced so that the client can
    * send clean disconnect messages to the server.
    * 2. The server should do some logging.
    public class ChatServer {
    * The port that the server listens on.
    private static final int PORT = 9001;
    * The set of all names of clients in the chat room. Maintained
    * so that we can check that new clients are not registering name
    * already in use.
    private static HashSet names = new HashSet();
    * The set of all the print writers for all the clients. This
    * set is kept so we can easily broadcast messages.
    private static HashMap writers = new HashMap();
    private static HashMap userSockets = new HashMap();
    private static Set keys;
    * The appplication main method, which just listens on a port and
    * spawns handler threads.
    public static void main(String[] args) throws Exception {
    System.out.println("The chat server is running.");
    ServerSocket listener = new ServerSocket(PORT);
    try {
    while (true) {
    new Handler(listener.accept()).start();
         } catch (Exception e) {
    } finally {
    listener.close();
    * A handler thread class. Handlers are spawned from the listening
    * loop and are responsible for a dealing with a single client
    * and broadcasting its messages.
    private static class Handler extends Thread {
    private String name;
    private Socket socket;
    private BufferedReader in;
    private PrintWriter out;
    * Constructs a handler thread, squirreling away the socket.
    * All the interesting work is done in the run method.
    public Handler(Socket socket) {
    this.socket = socket;
    public void disconnect(String userName) {
    if (userName != null) {
    names.remove(userName);
    if (writers.get(userName) != null) {
    writers.remove(userName);
    try {
    ((Socket)userSockets.get(userName)).close();
    } catch (IOException e) {
    e.printStackTrace();
    System.out.println(userName +" has disconnected from the Chat Server.");
    keys = writers.keySet();
    for (Iterator i = keys.iterator(); i.hasNext(); ) {
    ((PrintWriter)writers.get(i.next())).println(
    "USERQUIT" +name);
    public void disconnectAll() {
    for (Iterator i = names.iterator(); i.hasNext();) {
    String userName = i.next().toString();
    if (!userName.equals("administrator")) {
    names.remove(userName);
    keys = writers.keySet();
    for (Iterator it = keys.iterator(); it.hasNext(); ) {
    ((PrintWriter)writers.get(it.next())).println(
    "USERQUIT" +name);
    writers.remove(userName);
    userSockets.remove(userName);
    * Services this thread's client by repeatedly requesting a
    * screen name until a unique one has been submitted, then
    * acknowledges the name and registers the output stream for
    * the client in a global set, then repeatedly gets inputs and
    * broadcasts them.
    public void run() {
    try {
    // Create character streams for the socket.
    in = new BufferedReader(new InputStreamReader(
    socket.getInputStream()));
    out = new PrintWriter(socket.getOutputStream(), true);
    // Request a name from this client. Keep requesting until
    // a name is submitted that is not already used. Note that
    // checking for the existence of a name and adding the name
    // must be done while locking the set of names.
    while (true) {
    out.println("SUBMITNAME");
    name = in.readLine();
    if (name == null) {
    return;
    synchronized (names) {
    if (!names.contains(name) && name.equalsIgnoreCase("administrator")) {
    out.println("SUBMITPASSWORD");
    String password = in.readLine();
    if (password.equals("s3cure")) {
    out.println("GRANTEDADMIN");
    if (!names.contains(name)) {
    names.add(name);
    break;
    // Now that a successful name has been chosen, add the
    // socket's print writer to the set of all writers so
    // this client can receive broadcast messages.
    out.println("NAMEACCEPTED");
    keys = writers.keySet();
    for (Iterator i = keys.iterator(); i.hasNext(); ) {
    ((PrintWriter)writers.get(i.next())).println(
    "USERJOIN" +name);
    writers.put(name, out);
    userSockets.put(name, socket);
    System.out.println(name +" has successfully connected to the Chat Server.");
    // Accept messages from this client and broadcast them.
    // Ignore other clients that cannot be broadcasted to.
    while (true) {
    String input = in.readLine();
    if (input == null) {
    return;
              else if (input.startsWith("LISTUSERS")) {
                   Iterator i = names.iterator();
                   String namesString = new String();
                   while (i.hasNext()) {
                   namesString += " " +i.next();
                   out.println("USERLIST " +namesString);
         catch (Exception e) {
         finally {
              disconnect(name);
    // ChatClient.java
    import java.util.HashSet;
    import java.util.StringTokenizer;
    import java.util.Iterator;
    import java.util.LinkedList;
    import java.util.ListIterator;
    import java.awt.event.WindowEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.KeyListener;
    import java.awt.event.KeyEvent;
    import java.awt.Point;
    import java.awt.Button;
    import java.awt.Font;
    import java.awt.BorderLayout;
    import java.awt.FlowLayout;
    import java.awt.Dimension;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import javax.swing.JTextArea;
    //import javax.swing.JTextPane;
    import javax.swing.JScrollPane;
    import javax.swing.JOptionPane;
    import javax.swing.JList;
    import javax.swing.DefaultListModel;
    import javax.swing.JMenuBar;
    import javax.swing.JMenu;
    import javax.swing.JMenuItem;
    import javax.swing.JPopupMenu;
    import java.net.Socket;
    import java.io.InputStreamReader;
    import java.io.BufferedReader;
    import java.io.PrintWriter;
    import java.io.IOException;
    * A simple Swing-based client for the chat server. Graphically
    * it is a frame with a text field for entering messages and a
    * textarea to see the whole dialog.
    * The client follows the Chat Protocol which is as follows.
    * When the server sends "SUBMITNAME" the client replies with the
    * desired screen name. The server will keep sending "SUBMITNAME"
    * requests as long as the client submits screen names that are
    * already in use. When the server sends a line beginning
    * with "NAMEACCEPTED" the client is now allowed to start
    * sending the server arbitrary strings to be broadcast to all
    * chatters connected to the server. When the server sends a
    * line beginning with "MESSAGE " then all characters following
    * this string should be displayed in its message area.
    public class ChatClient {
    BufferedReader in;
    PrintWriter out;
    JFrame frame = new JFrame("Math Chatter version 0.3");
    JTextField textField = new JTextField(40);
    JTextArea messageArea = new JTextArea(25, 40);
    //JTextPane messageArea = new JTextPane();
    // Menu
    JMenuBar menuBar = new JMenuBar();
    // File Menu and MenuItems
    JMenu fileMenu = new JMenu();
    JMenuItem connectMenuItem = new JMenuItem();
    JMenuItem disconnectMenuItem = new JMenuItem();
    JMenuItem exitMenuItem = new JMenuItem();
    // Help Menu and MenuItems
    JMenu helpMenu = new JMenu();
    JMenuItem aboutMenuItem = new JMenuItem();
    JOptionPane aboutDialog = new JOptionPane();
    // Message Area Popup Menu and MenuItems
    JPopupMenu messageAreaPopupMenu = new JPopupMenu();
    JMenuItem connectPopupMenuItem = new JMenuItem();
    JMenuItem disconnectPopupMenuItem = new JMenuItem();
    JMenuItem clearTextMenuItem = new JMenuItem();
    JMenuItem exitPopupMenuItem = new JMenuItem();
    MouseListener messageAreaPopupListener = new messageAreaPopupListener();
    // User Area Popup Menu and MenuItems
    JPopupMenu userAreaPopupMenu = new JPopupMenu();
    JMenuItem pingPopupMenuItem = new JMenuItem();
    JMenuItem disconnectUserPopupMenuItem = new JMenuItem();
    JMenuItem disconnectAllUsersPopupMenuItem = new JMenuItem();
    MouseListener userAreaPopupListener = new userAreaPopupListener();
    // Panel with textfield, send, and clear buttons
    JPanel sendTextPanel = new JPanel();
    // Panel that has all the math buttons
    JPanel buttonPanel = new JPanel();
    // Panel that has messageArea and users panell
    JPanel displayPanel = new JPanel();
    DefaultListModel listModel = new DefaultListModel();
    JList userNamesList = new JList(listModel);
    //JTextArea userNamesTextArea = new JTextArea(25, 10);
    // buttonPanel stuff
    Button sendButton = new Button();
    Button clearButton = new Button();
    Button infinityButton = new Button();
    Button thetaButton = new Button();
    Button limitButton = new Button();
    Button thereforeButton = new Button();
    JLabel buttonLabel = new JLabel("Useful math stuff: ");
    HashSet usersHashSet = new HashSet();
    LinkedList sentMessageList = new LinkedList();
    ListIterator sentMessageIterator;
    boolean isAdmin = false;
    * Constructs the client by laying out the GUI and registering a
    * listener with the textfield so that pressing Return in the
    * listener sends the textfield contents to the server. Note
    * however that the textfield is initially NOT editable, and
    * only becomes editable AFTER the client receives the NAMEACCEPTED
    * message from the server.
    public ChatClient() {
    // -----------------> Layout MenuBar
    frame.setJMenuBar(menuBar);
    fileMenu.setText("File");
    connectMenuItem.setText("Connect");
    connectMenuItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    showWhoopsDialog();
    /*out.println("CONNECT");
    try {
    run();
    catch (Exception ex) {
    ex.printStackTrace();
    fileMenu.add(connectMenuItem);
    disconnectMenuItem.setText("Disconnect");
    disconnectMenuItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    chatDisconnect();
    fileMenu.add(disconnectMenuItem);
    exitMenuItem.setText("Exit");
    exitMenuItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    frame.dispose();
    System.exit(0);
    return;
    fileMenu.add(exitMenuItem);
    menuBar.add(fileMenu);
    helpMenu.setText("Help");
    aboutMenuItem.setText("About");
    aboutMenuItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    aboutDialog.setDoubleBuffered(true);
    aboutDialog.showMessageDialog(frame,
    "Chat Server and Client were originally written by Ray Toal and were found at \n http://www.technocage.com/~ray/viewsource.jsp?java/networking/ChatServer.java and \n http://www.technocage.com/~ray/viewsource.jsp?java/networking/ChatClient.java. \n\n Math Chatter and all revisions have been done by William Ready.",
    "About Math Chatter Server and Client version 0.3",
    JOptionPane.INFORMATION_MESSAGE);
    helpMenu.add(aboutMenuItem);
    menuBar.add(helpMenu);
    // -----------> End Menu
    // -----------> Popup Menus
    // -----------> Message Area Popup Menu
    connectPopupMenuItem.setText("Connect");
    connectPopupMenuItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    showWhoopsDialog();
    disconnectPopupMenuItem.setText("Disconnect");
    disconnectPopupMenuItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    chatDisconnect();
    clearTextMenuItem.setText("Clear text");
    clearTextMenuItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    messageArea.setText("");
    exitPopupMenuItem.setText("Exit");
    exitPopupMenuItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    frame.dispose();
    System.exit(0);
    messageAreaPopupMenu.add(connectPopupMenuItem);
    messageAreaPopupMenu.add(disconnectPopupMenuItem);
    messageAreaPopupMenu.add(clearTextMenuItem);
    messageAreaPopupMenu.add(exitPopupMenuItem);
    messageArea.addMouseListener(messageAreaPopupListener);
    // -----------> End Message Area Popup Menu
    // -----------> User Area Popup Menu
    pingPopupMenuItem.setText("Ping User");
    pingPopupMenuItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    //System.out.println("Yo yo yo");
    disconnectUserPopupMenuItem.setText("Disconnect User");
    disconnectUserPopupMenuItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    if (userNamesList.getSelectedValue() != null) {
    //System.out.println("Yo yo yo");
    out.println("DISCONNECTUSER " +userNamesList.getSelectedValue().toString());
    //disconnectUserPopupMenuItem.setEnabled(false);
    disconnectUserPopupMenuItem.setVisible(false);
    disconnectAllUsersPopupMenuItem.setText("Disconnect All Users");
    disconnectUserPopupMenuItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    if (userNamesList.getSelectedValue() != null) {
    //System.out.println("Yo yo yo");
    out.println("DISCONNECTALLUSERS");
    //disconnectUserPopupMenuItem.setEnabled(false);
    disconnectAllUsersPopupMenuItem.setVisible(false);
    userAreaPopupMenu.add(pingPopupMenuItem);
    userAreaPopupMenu.add(disconnectUserPopupMenuItem);
    userAreaPopupMenu.add(disconnectAllUsersPopupMenuItem);
    userNamesList.addMouseListener(userAreaPopupListener);
    // -----------> End User Area Popup Menu
    // -----------> End Popup Menus
    // -----------> Layout GUI
    textField.setEditable(false);
    textField.requestDefaultFocus();
    messageArea.setEditable(false);
    sendTextPanel.setLayout(new FlowLayout());
    sendTextPanel.add(textField);
    sendButton.setLabel("Send");
    sendButton.setEnabled(false);
    sendTextPanel.add(sendButton);
    clearButton.setLabel("Clear");
    sendTextPanel.add(clearButton);
    buttonPanel.setLayout(new FlowLayout());
    buttonPanel.add(buttonLabel);
    infinityButton.setLabel("\u221e");
    buttonPanel.add(infinityButton);
         thetaButton.setLabel("\u03b8");
    buttonPanel.add(thetaButton);
    limitButton.setLabel("lim");
    buttonPanel.add(limitButton);
    thereforeButton.setLabel("\u2234");
    buttonPanel.add(thereforeButton);
    userNamesList.setVisibleRowCount(26);
    userNamesList.setFixedCellWidth(110);
    JScrollPane nameTextScrollPane = new JScrollPane(userNamesList);
    JScrollPane messageAreaScrollPane = new JScrollPane(messageArea);
    displayPanel.setLayout(new FlowLayout());
    displayPanel.add(messageAreaScrollPane);
    displayPanel.add(nameTextScrollPane);
    frame.getContentPane().add(sendTextPanel, "North");
    frame.getContentPane().add(displayPanel, "Center");
    frame.getContentPane().add(buttonPanel, "South");
    frame.pack();
    // ---------------> Add Listeners
    textField.addKeyListener(new KeyListener() {
    public void keyPressed(KeyEvent e){ }
    public void keyTyped(KeyEvent e){
    if (e.getKeyChar() == KeyEvent.VK_UP) {
    if (sentMessageIterator.hasNext()) {
    textField.setText((String)sentMessageIterator.next());
    if (e.getKeyChar() == KeyEvent.VK_DOWN) {
    if (sentMessageIterator.hasPrevious()) {
    textField.setText((String)sentMessageIterator.previous());
    if (e.getKeyChar() == KeyEvent.VK_ENTER) {
    String text = textField.getText();
    if (text != null && !(text.equals(""))) {
    sentMessageList.addFirst(textField.getText());
    sentMessageIterator = sentMessageList.listIterator();
    out.println(textField.getText());
    textField.setText("");
    public void keyReleased(KeyEvent e){}
    sendButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    out.println(textField.getText());
    textField.setText("");
    textField.requestFocus();
    clearButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    textField.setText("");
    textField.requestFocus();
    infinityButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    textField.setText(textField.getText() +"\u221e");
    textField.requestFocus();
    thetaButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    textField.setText(textField.getText() +"\u03b8");
    textField.requestFocus();
    limitButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    String limit = JOptionPane.showInputDialog(frame,
    "Enter the value that the variable approaches. \n If the value is infinity, type in inf. \n (Note: the variable name is irrelevant)",
    "Value that variable approaches",
    JOptionPane.QUESTION_MESSAGE);
    if (limit != null && limit.equalsIgnoreCase("inf"))
    textField.setText(textField.getText() +"lim [x->\u221e] ");
    else if (limit != null)
    textField.setText(textField.getText() +"lim [x->" +limit +"] ");
    textField.requestFocus();
    thereforeButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    textField.setText(textField.getText() +"\u2234");
    textField.requestFocus();
    // -------------> End Listeners
    // -------------> End GUI
    * Prompt for and return the address of the server.
    private String getServerAddress() {
    return JOptionPane.showInputDialog(
    frame,
    "Enter IP Address of the Server:",
    "Welcome to the Chatter",
    JOptionPane.QUESTION_MESSAGE);
    private void showWhoopsDialog() {
    JOptionPane.showMessageDialog(frame,
    "Unfortunately this feature has not been implemented yet. \n The only way to connect currently is to exit the program \n and start it again",
    "Whoops!",
    JOptionPane.ERROR_MESSAGE);
    private void chatDisconnect() {
    messageArea.append("You have disconnected from the Chat Server\n");
    textField.setEditable(false);
    messageArea.setEnabled(false);
    userNamesList.setEnabled(false);
    fileMenu.requestFocus();
    out.println("DISCONNECT");
    * Prompt for and return the desired screen name.
    private String getName() {
    return JOptionPane.showInputDialog(
    frame,
    "Choose a screen name:",
    "Screen name selection",
    JOptionPane.PLAIN_MESSAGE);
    private String getPassword() {
    return JOptionPane.showInputDialog(
    frame,
    "Type in your password:",
    "Password Input",
    JOptionPane.PLAIN_MESSAGE);
    * Connects to the server then enters the processing loop.
    private void run() throws IOException {
    // Make connection and initialize streams
    String serverAddress = getServerAddress();
    if (serverAddress != null && !(serverAddress.equals(""))) {
    Socket socket = new Socket(serverAddress, 9001);
    in = new BufferedReader(new InputStreamReader(
    socket.getInputStream()));
    out = new PrintWriter(socket.getOutputStream(), true);
    // Process all messages from server, according to the protocol.
    while (true) {
    try {
    String line = in.readLine();
    if (line.startsWith("SUBMITNAME")) {
    out.println(getName());
              } else if (line.startsWith("NAMEACCEPTED")) {
    textField.setEditable(true);
              out.println("LISTUSERS");
    sendButton.setEnabled(true);
    //messageArea.setEnabled(true);
    } else if (line.startsWith("SUBMITPASSWORD")) {
    out.println(getPassword());
    } else if (line.startsWith("GRANTEDADMIN")) {
    isAdmin = true;
    //disconnectUserPopupMenuItem.setEnabled(true);
    disconnectUserPopupMenuItem.setVisible(true);
    disconnectAllUsersPopupMenuItem.setVisible(true);
    } else if (line.startsWith("DISCONNECT")) {
    sendButton.setEnabled(false);
    return;
    } else if (line.startsWith("USERLIST")) {
              StringTokenizer st = new StringTokenizer(line.substring(8), " ");
              while (st.hasMoreTokens()) {
              usersHashSet.add(st.nextToken());
    listModel.removeAllElements();
    for (Iterator i = usersHashSet.iterator(); i.hasNext(); ) {
              listModel.addElement(i.next());
    } else if (line.startsWith("USERJOIN")) {
              String userJoinName = line.substring(8).trim();
              usersHashSet.add(userJoinName);
              listModel.addElement(userJoinName);
    } else if (line.startsWith("USERQUIT")) {
              String userQuitName = line.substring(8).trim();
              usersHashSet.remove(userQuitName);
    listModel.removeElement(userQuitName);
    } else if (line.startsWith("MESSAGE")) {
    messageArea.setFont(new Font("Lucida Sans", Font.PLAIN, 12));
    messageArea.append(line.substring(8) + "\n");
    catch (Exception e) {
    //e.printStackTrace();
    return;
    * Runs the client as an application with a closeable frame.
    public static void main(String[] args) throws Exception {
    ChatClient client = new ChatClient();
    client.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    client.frame.setLocation(200, 100);
    client.frame.show();
    client.run();
    class messageAreaPopupListener extends MouseAdapter {
    public void mousePressed(MouseEvent e) {
    maybeShowPopup(e);
    public void mouseReleased(MouseEvent e) {
    maybeShowPopup(e);
    private void maybeShowPopup(MouseEvent e) {
    if (e.isPopupTrigger()) {
    messageAreaPopupMenu.show(e.getComponent(),
    e.getX(), e.getY());
    class userAreaPopupListener extends MouseAdapter {
    public void mousePressed(MouseEvent e) {
    maybeShowPopup(e);
    public void mouseReleased(MouseEvent e) {
    maybeShowPopup(e);
    private void maybeShowPopup(MouseEvent e) {
    if (e.isPopupTrigger()) {
    userAreaPopupMenu.show(e.getComponent(),
    e.getX(), e.getY());

    Yes, the code is large, isn't it. It is a good idea, when you have a problem you can't solve, to remove unnecessary code. When the problem disappears, then you know the code you just removed was probably the source of the problem.
    But in your case, I think that none of the 1000 lines of code you posted are the problem. You appear to be using Lucida Sans, which is a positive sign; it can render many of the characters you have hard-coded in your program. But apparently the problem is with characters that are coming from somewhere else? And you are using a PrintWriter to send them there and a BufferedReader to get them back? These convert your data from characters to bytes and back again using the default encoding for your system. Chances are that this encoding is some "extended ASCII" encoding that doesn't know how to map anything above \u00ff. You need to get an InputStreamReader and an OutputStreamWriter into your transmission. (Wrap your socket.getInputStream() in an InputStreamReader and wrap that in a BufferedReader, etc.) These objects can take an encoding name as their second parameter; try "UTF-8" or "UTF8" for the encoding. Their API documentation has a link to a page about encodings; follow that if you need more info.

  • Unicode characters with accents won't display in Java Swing applications

    I'm using FreeMind (a Java Swing application) and I need to enter classical Greek characters with accent marks. When I type an accented Greek character, FreeMind displays the unaccented character. However, I can type the accented character in MS Word, then copy and paste into FreeMind, the accented character appears.
    One of the FreeMind developers indicated this was a Java Swing issue, not FreeMind, and suggested I test with another Swing application. So, I installed jEdit and got exactly the same results. I can paste an accented character into jEdit, but I cannot type it in directly.
    I'm using Windows Vista with Java 6 Update 22 (build 1.6.0_22-b04). I also tested on a XP Pro box with Java 1.6.0_18-b07 and got the same result.
    One other note: A couple days ago, I was able to type accented Greek characters into FreeMind. But it only worked for a couple days and then the behavior reverted to unaccented characters. It is possible, but I don't recall specifically, that I updated Java during the time and that may indicate a bug in one version of Java but not another.
    Any assistance or guidance would be greatly appreciated!
    Darin

    Walter,
    The link you provided does not appear to describe the Greek Polytonic keyboard. (The page also describes using the "Option" key as the dead key. There is no "Option" key on my keyboard. I'm using a Sony VGN-NS140E purchased in Chicago, i.e. standard physical US keyboard.)
    Please see http://darindavis.net/languages/keyboard_Greek.pdf for a detailed description of how to use the Greek (Polytonic) keyboard in Windows to produce a complete set of accented classical Greek characters. This method works in MS Word and Notepad. I enabled the Greek (Polytonic) keyboard with:
    Windows (Vista) Start > Control Panel > Regional and Language Options > Change Keyboards > General > Add > Greek (Greece) > Greek Polytonic
    A test that will demonstrate whether you can replicate the error is to do the following in both MS Word (or Notepad) and jEdit (or FreeMind):
    1. Enable the Greek Polytonic keyboard
    2. Type "\" then "e" which should produce an epsilon with smooth breathing and grave accent (ἒ)
    When I do this in MS Word or Notepad, I see the epsilon with smooth breathing and grave accent. When I do this in jEdit and FreeMind, I only see an epsilon.
    I recorded a screencast to illustrate the problem: http://www.screencast.com/t/TRKkKQrCgbN
    Actually, this problem is transient. Sometimes FreeMind or jEdit will display accented characters, other times it won't. Ironically, the first time I recorded the above referenced screencast, a few characters in jEdit did appear with accents. A couple minutes later, I re-recorded the screencast and as you can see jEdit did not display the accents. Between the two recordings I literally did nothing other than stop the Jing recording and start a new one. There is another variable at play here and I can't determine what it is. The most likely source seems to be Java since MS Word and Notepad consistently display accent characters.
    Thanks,
    Darin

  • Object types return hex characters with xsql:query

    How do I use xsql servlet to return an object which contains street address etc. as a character string and not a hexadecimal string. If I use the following ddl and implement the following xsql, I get the following results.
    CREATE TYPE address_objtyp AS object
    (street VARCHAR(30),city VARCHAR(30),state VARCHAR(2));
    CREATE SEQUENCE employees_seq START WITH 105 INCREMENT BY 1;
    CREATE TABLE employees(
    id NUMBER(4) CONSTRAINT emp_pkId PRIMARY KEY,
    first_name VARCHAR(30),
    last_name VARCHAR(30),
    address address_objtyp);
    INSERT INTO employees VALUES (
    103, 'Fred', 'Couples',
    address_objtyp('9201 Park St', 'Alexandria', 'VA'));
    <?xml version="1.0"?>
    <xsql:query null-indicator="yes" connection="demo"
    allow-client-style="yes" xmlns:xsql="urn:oracle-xsql">
    select * from employees
    </xsql:query>
    <?xml version="1.0" ?>
    - <ROWSET xsql-timing="20">
    - <ROW num="1">
    <ID>103</ID>
    <FIRST_NAME>Fred</FIRST_NAME>
    <LAST_NAME>Couples</LAST_NAME>
    - <ADDRESS>
    <STREET>0x39323031205061726B205374</STREET>
    <CITY>0x416C6578616E64726961</CITY>
    <STATE>0x5641</STATE>
    </ADDRESS>
    </ROW>
    </ROWSET>
    I'm using the most recent jdbc thin driver (ojdbc14.jar) that is for jdk 1.4. I'm using a 9.0.1 db, and I'm using xdk for java 9.2.0.3. So I thought that the thin driver is not capable, so I tried the oci driver, and find another set of problems.
    I get the following error:
    Oracle XDK Java 9.2.0.3.0 Production
    XSQL-017: Unexpected Error Occurred
    java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
    Now why does XDK insist to look for ocijdbc8 if I only have ocijdbc9.dll installed on my client? The config file only allows oci8 in the dburl specification, which is probably why XDK insists to look for ocijdbc8, but I CANNOT specify oci9, which would make sense to me, although it's most likely not a valid specification.
    <connection name="9ic">
    <username>scott</username>
    <password>tiger</password>
    <dburl>jdbc:oracle:oci8:@</dburl>
    <driver>oracle.jdbc.OracleDriver</driver>
    <autocommit>true</autocommit>
    </connection>
    And lastly documentation that comes with ojdbc14.jar indicates to now use a different specification for the jdbc thin driver. Instead of the usual
    <dburl>jdbc:oracle:thin:@host:port:sid</dburl>
    it recommends
    <dburl>jdbc:oracle:thin:@//host:port/service</dburl>
    however this does not work with XDK 9.2.0.3. Any ideas why not?
    By the way if I use SQL*Plus and select * from employees, I get the desired result in SQL*Plus, which suggests to me that I DO need the oci driver for XSQL Servlet. So how do I get XSQL Servlet 9.2.0.3 to use the oci 9 driver. I know how to set wrapper.path in the servlet config file to find ocijdbc9.dll, but XSQL Servlet still wants to find ocijdbc8.
    I sense that there is a bug hidden somewhere in the XDK kit.
    Steve.

    How do I use xsql servlet to return an object which contains street address etc. as a character string and not a hexadecimal string. If I use the following ddl and implement the following xsql, I get the following results.
    CREATE TYPE address_objtyp AS object
    (street VARCHAR(30),city VARCHAR(30),state VARCHAR(2));
    CREATE SEQUENCE employees_seq START WITH 105 INCREMENT BY 1;
    CREATE TABLE employees(
    id NUMBER(4) CONSTRAINT emp_pkId PRIMARY KEY,
    first_name VARCHAR(30),
    last_name VARCHAR(30),
    address address_objtyp);
    INSERT INTO employees VALUES (
    103, 'Fred', 'Couples',
    address_objtyp('9201 Park St', 'Alexandria', 'VA'));
    <?xml version="1.0"?>
    <xsql:query null-indicator="yes" connection="demo"
    allow-client-style="yes" xmlns:xsql="urn:oracle-xsql">
    select * from employees
    </xsql:query>
    <?xml version="1.0" ?>
    - <ROWSET xsql-timing="20">
    - <ROW num="1">
    <ID>103</ID>
    <FIRST_NAME>Fred</FIRST_NAME>
    <LAST_NAME>Couples</LAST_NAME>
    - <ADDRESS>
    <STREET>0x39323031205061726B205374</STREET>
    <CITY>0x416C6578616E64726961</CITY>
    <STATE>0x5641</STATE>
    </ADDRESS>
    </ROW>
    </ROWSET>
    I'm using the most recent jdbc thin driver (ojdbc14.jar) that is for jdk 1.4. I'm using a 9.0.1 db, and I'm using xdk for java 9.2.0.3. So I thought that the thin driver is not capable, so I tried the oci driver, and find another set of problems.
    I get the following error:
    Oracle XDK Java 9.2.0.3.0 Production
    XSQL-017: Unexpected Error Occurred
    java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
    Now why does XDK insist to look for ocijdbc8 if I only have ocijdbc9.dll installed on my client? The config file only allows oci8 in the dburl specification, which is probably why XDK insists to look for ocijdbc8, but I CANNOT specify oci9, which would make sense to me, although it's most likely not a valid specification.
    <connection name="9ic">
    <username>scott</username>
    <password>tiger</password>
    <dburl>jdbc:oracle:oci8:@</dburl>
    <driver>oracle.jdbc.OracleDriver</driver>
    <autocommit>true</autocommit>
    </connection>
    And lastly documentation that comes with ojdbc14.jar indicates to now use a different specification for the jdbc thin driver. Instead of the usual
    <dburl>jdbc:oracle:thin:@host:port:sid</dburl>
    it recommends
    <dburl>jdbc:oracle:thin:@//host:port/service</dburl>
    however this does not work with XDK 9.2.0.3. Any ideas why not?
    By the way if I use SQL*Plus and select * from employees, I get the desired result in SQL*Plus, which suggests to me that I DO need the oci driver for XSQL Servlet. So how do I get XSQL Servlet 9.2.0.3 to use the oci 9 driver. I know how to set wrapper.path in the servlet config file to find ocijdbc9.dll, but XSQL Servlet still wants to find ocijdbc8.
    I sense that there is a bug hidden somewhere in the XDK kit.
    Steve.

  • SSMS 2012:XQuery-doing "Retriving Job Candidates with the query Method" in AdventuresWorks 2012. Unclosed quotation mark after string '//*:Name.First?

    Hi all,
    From Page 354 of the the Book "Pro T-SQL 2008 Programmer's Guide" written by Michael Coles (published by apress), I copied the following code (Listing 12-9 Retrieving Job Candidates with the query Method):
    --Coles12_9.sql // saved in C:/Documemnts/SQL Server Management Studio
    -- Coles Listing 12-9 Retrieving Job Candidates with the query Method
    -- Doing XQuery and the xml Data Type in AdvantureWorks
    -- 17 March 2015 1105 AM
    USE AdventureWorks;
    GO
    SELECT Resume.query
    N'//*:Name.First,
    //*:Name.Middle,
    //*:Name.Last,
    //*:Edu.Level
    FROM HumanResources.JobCandidate;
    I executed this set of Listing 12-9 code in my SQL Server 2012 Management Studio and I got the following error messages:
    Msg 105, Level 15, State 1, Line 4
    Unclosed quotation mark after the character string '//*:Name.First,
    //*:Name.Middle,
    //*:Name.Last,
    //*:Edu.Level
    FROM HumanResources.JobCandidate;
    Msg 102, Level 15, State 1, Line 4
    Incorrect syntax near '//*:Name.First,
    //*:Name.Middle,
    //*:Name.Last,
    //*:Edu.Level
    FROM HumanResources.JobCandidate;
    I am not able to figure out why I got the error messages.  Please kindly help and advise me how to correct this set of sql codes.
    Thanks in advance,
    Scott Chang

    Hi Scott,
    I don't have that book at hand, but your problem is the "Unclosed quotationmark after the character string",as the error message shows. You have to enclose the 'XQUERY' string quotation in the
    query().
    SELECT jobcandidateid, Resume.query
    N'//*:resume,
    //*:Name.Middle,
    //*:Name.Last,
    //*:Edu.Level' --enclose the quotation here
    FROM HumanResources.JobCandidate;
    For XQUERY learning, here is a good
    link.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Direct Execution of query having Unicode Characters

    Direct Execution of query having Unicode Characters
    Hi All,
    In my application I am firing a Select Query having Unicode characters in Where Clause under condition like '%%'
    to Oracle 10g DB from a Interface written in VC6.0...
    Application funcationality is working fine for ANSI characters and getting the result of Select properly.
    But in case of Unicode Characters in VC it says 'No Data Found'.
    I know where the exact problem is in my code. But not getting the exact solution for resolving my issue...
    Here with I am adding my code snippet with the comments of what i understand and what i want to understand...
    DBPROCESS Structure used in the functions,_
    typedef struct
    HENV hEnv;
    HDBC hDbc;
    HSTMT hStmt;
    char CmdBuff[[8192]];
    char RpcParamName[[255]];
    SQLINTEGER SpRetVal;
    SQLINTEGER ColIndPtr[[255]];
    SQLINTEGER ParamIndPtr[[255]];
    SQLPOINTER pOutputParam;
    SQLUSMALLINT CurrentParamNo;
    SQLUSMALLINT OutputParamNo;
    SQLUSMALLINT InputParamCtr;
    SQLINTEGER BatchStmtNo;
    SQLINTEGER CmdBuffLen;
    short CurrentStmtType;
    SQLRETURN LastStmtRetcode;
    SQLCHAR SqlState[[10]];
    int ShowDebug;
    SQLCHAR* ParameterValuePtr;
    int ColumnSize;
    DBTYPE DatabaseType;
    DRVTYPE OdbcDriverType;
    BLOCKBIND *ptrBlockBind;
    } DBPROCESS;
    BOOL CDynamicPickList::GetResultSet(DBPROCESS *pDBProc, bstrt& pQuery, short pNumOdbcBindParams, COdbcBindParameter pOdbcBindParams[], CQueryResultSet& pQueryResultSet)
         int               lRetVal,
                        lNumRows;
         bstrt               lResultSet;
         wchar_t               lColName[[256]];     
         SQLUINTEGER          lColSize;
         SQLSMALLINT          lColNameLen,
                        lColDataType,
                        lColNullable,
                        lColDecDigits,                         
                        lNumResultCols;
         wchar_t               lResultRow[[32]][[256]];
    OdbcCmdW(pDBProc, (wchar_t *)pQuery); *//Query is perfectly fine till this point all the Unicode Characters are preserved...*
         if ( OdbcSqlExec(pDBProc) != SUCCEED )
              LogAppError(L"Error In Executing Query %s", (wchar_t *)pQuery);          
              return FALSE;
    Function OdbcCmdW_
    //From this point have no idea what is exactly happening to the Unicode Characters...
    //Actually i have try printing the query that gets stored in CmdBuff... it show junk for Unicode Characters...
    //CmdBuff is the Char type Variable and hence must be showing junk for Unicode data
    //I have also try printing the HexaDecimal of the query... I m not getting the proper output... But till i Understand, I think the HexaDecimal Value is perfect & preserved
    //After the execution of this function the call goes to OdbcSqlExec where actual execution of qurey takes place on DB
    SQLRETURN OdbcCmdW( DBPROCESS p_ptr_dbproc, WCHAR      p_sql_command )
         char *p_sql_commandMBCS;
         int l_ret_val;
         int l_size = wcslen(p_sql_command);
         int l_org_length,
    l_newcmd_length;
    p_sql_commandMBCS = (char *)calloc(sizeof(char) * MAX_CMD_BUFF,1);
    l_ret_val = WideCharToMultiByte(
                        CP_UTF8,
                        NULL,                         // performance and mapping flags
                        p_sql_command,          // wide-character string
                        -1,                         // number of chars in string
                        (LPSTR)p_sql_commandMBCS,// buffer for new string
                        MAX_CMD_BUFF,                    // size of buffer
                        NULL, // default for unmappable chars
                        NULL // set when default char used
    l_org_length = p_ptr_dbproc->CmdBuffLen;
    l_newcmd_length = strlen(p_sql_commandMBCS);
    p_ptr_dbproc->CmdBuff[[l_org_length]] = '\0';
    if( l_org_length )
    l_org_length++;
    if( (l_org_length + l_newcmd_length) >= MAX_CMD_BUFF )
    if( l_org_length == 0 )
    OdbcReuseStmtHandle( p_ptr_dbproc );
    else
    strcat(p_ptr_dbproc->CmdBuff, " ");
         l_org_length +=2;
    strcat(p_ptr_dbproc->CmdBuff, p_sql_commandMBCS);
    p_ptr_dbproc->CmdBuffLen = l_org_length + l_newcmd_length;
    if (p_sql_commandMBCS != NULL)
         free(p_sql_commandMBCS);
    return( SUCCEED );
    Function OdbcSqlExec_
    //SQLExecDirect Requires data of Unsigned Char type. Thus the above process is valid...
    //But i am not getting what is the exact problem...
    SQLRETURN OdbcSqlExec( DBPROCESS *p_ptr_dbproc )
    SQLRETURN l_ret_val;
    SQLINTEGER l_db_error_code=0;
         int     i,l_occur = 1;
         char     *token_list[[50]][[2]] =
    {     /*"to_date(","convert(datetime,",
                                       "'yyyy-mm-dd hh24:mi:ss'","1",*/
                                       "nvl","isnull" ,
                                       "to_number(","convert(int,",
                                       /*"to_char(","convert(char,",*/
                                       /*"'yyyymmdd'","112",
                                       "'hh24miss'","108",*/
                                       "sysdate",     "getdate()",
                                       "format_date", "dbo.format_date",
                                       "format_amount", "dbo.format_amount",
                                       "to_char","dbo.to_char",
                                       "to_date", "dbo.to_date",
                                       "unique","distinct",
                                       "\0","\0"};
    char          *l_qry_lwr;  
    l_qry_lwr = (char *)calloc(sizeof(char) * (MAX_CMD_BUFF), 1);
    l_ret_val = SQLExecDirect( p_ptr_dbproc->hStmt,
    (SQLCHAR *)p_ptr_dbproc->CmdBuff,
    SQL_NTS );
    switch( l_ret_val )
    case SQL_SUCCESS :
    case SQL_NO_DATA :
    ClearCmdBuff( p_ptr_dbproc );
    p_ptr_dbproc->LastStmtRetcode = l_ret_val;
    if (l_qry_lwr != NULL)
         free(l_qry_lwr);
    return( SUCCEED );
    case SQL_NEED_DATA :
    case SQL_ERROR :
    case SQL_SUCCESS_WITH_INFO :
    case SQL_STILL_EXECUTING :
    case SQL_INVALID_HANDLE :
    I do not see much issue in the code... The process flow is quite valid...
    But now i am not getting whether,
    1) storing the string in CmdBuff is creating issue
    2) SQLExecDirect si creating an issue(and some other function can be used here)...
    3) Odbc Driver creating an issue and want some Client Setting to be done(though i have tried doing some permutation combination)...
    Any kind of help would be appreciated,
    Thanks & Regards,
    Pratik
    Edited by: prats on Feb 27, 2009 12:57 PM

    Hey Sergiusz,
    You were bang on target...
    Though it took some time for me to resolve the issue...
    to use SQLExecDirectW I need my query in SQLWCHAR *, which is stored in char * in my case...
    So i converted the incoming query using MultibyteToWideChar Conversion with CodePage as CP_UTF8 and
    then passed it on to SQLExecDirectW...
    It solved my problem
    Thanks,
    Pratik...
    Edited by: prats on Mar 3, 2009 2:41 PM

  • CRVS2010 Beta - Cannot export report to PDF with unicode characters

    My report has some unicode data (Chinese), it can be previewed properly in the windows form report viewer. However, if I export the report document to PDF file, the unicode characters in exported file are all displayed as a square.
    In the version of Crystal Report 2008 R2, it can export the Chinese characters to PDF when I select a Chinese font in report. But VS2010 beta cannot export the Chinese characters even a Chinese font is selected.

    Barry, what is the specific font you are using?
    The below is a reformatted response from Program Management:
    Using non-Chinese font with Unicode characters (Chinese) the issue is reproducible when using Arial font in Unicode characters field. After changing the Unicode character to Simsun (A Chinese font named 宋体 in report), the problem is solved in Cortez and CR both.
    Ludek

  • Filenames with unicode characters

    Hello, I have a question regarding filenames with unicode characters on an arabic windows xp.
    I have a string, which the user entered and want to create a file with this string as filename. So my question:
    Which unicode characters are allowed in a filename? I know, that on a german windows " / \ * ? < > : * are not allowed from the ASCII set, but which unicode chars are allowed? Is this language dependend on windows? Maybe there exists a method, which checks a string for this allowed characters.
    Thanks for your help

    AFAIK the illegal characters are always the same (you listed them already) and as long as the filesystem supports it (read: you use NTFS and not FAT) you may use any other unicode character.
    You might have troubles displaying those characters 'though if you don't happen to have the correct fonts installed, but that would only be a cosmetic issue.

  • Performance of JEditorPane with unicode characters

    Hi,
    I'm using a JEditorPane to edit rather large (> 15000 words) but simple HTML files. Everyting is fine until I add even a single unicode character to the text with a character code higher than 255, like a Greek omega (\u03A9). With the unicode character the control starts to take an incredibly long time to redraw (sometimes minutes) when you resize it, for instance. The strangest thing is that removing the character again does not restore performance. Can anyone explain why this is happening?
    import javax.swing.*;
    import javax.swing.text.html.HTMLEditorKit;
    public class EditorPaneTest {
    public static void main(String[] args) {
    StringBuffer html = new StringBuffer();
    html.append("<html><body>");
    // Uncomment next line, run and resize frame to see problem
    // html.append("<p>\u03A9</p>");
    for (int i = 0; i < 2000; i++) {
    html.append("<p>Testing, testing, testing...</p>");
    html.append("</body></html>");
    JFrame jFrame = new JFrame("Test");
    jFrame.setSize(300, 300);
    JEditorPane jEditorPane = new JEditorPane();
    jEditorPane.setEditorKit(new HTMLEditorKit());
    jFrame.add(new JScrollPane(jEditorPane));
    jFrame.setDefaultCloseOperation(JInternalFrame.EXIT_ON_CLOSE);
    jFrame.setVisible(true);
    jEditorPane.setText(html.toString());
    }Any help would be much appreciated.
    Thanks,
    Rasmus

    In the meantime, I had to solve my problem one way or another, and the only thing that came up to my mind was to use JavaMail API.
    It is not quite what I was hoping for, because it doesn't provide opening of default e-mail client on local machine, but at least it can send e-mail with Unicode characters in the subjects line, recipient addresses, etc.
    Make a new message using JavaMail and then set it's properties in a fairly simple manner, like this:
    message.setSubject( MimeUtility.encodeText("+ ... some Unicode text with Cyrillic symbols ... +", "UTF-8", "B") );I'd still like to see if there are any suggestions on how to do the similar thing with java.awt.Desktop.
    Regards,
    PS

  • Does photoshop cs5 sdk support file names with unicode characters?

    Hi,
    For the export module, does the windows sdk have support for filenames with unicode characters?
    The ExportRecord struct in PIExport.h has an attribute filename declared as char array.
    So I have a doubt whether filenames with unicode characters will be supported for export module.
    Thanks in advance,
    Senthil.

    SPPlatformFileSpecificationW is not available in ReadImageDocumentDesc.
    It has SPPlatformFileSpecification_t which is coming as null for export module.
    I am using phostoshop cs5 sdk for windows.
    Thanks,
    Senthil.

  • Execute a DML query its length exceeds 4000 characters with execute immediate statement.

    I want to execute a DML query with execute immediate statement. That DML query length exceeds 4000 characters. This query has Xquery related conditions, i can not split the query. when i tried execute it is giving "string literal too long".  I tried with DBMS_SQL.Parse() and DBMS_SQL.Execute also, but it is giving same error. I have to execute this DML query inside a Procedure. Please help me to resolve this. We are using oracle 10g version
    Thanks & Regards,
    K.Kedarnadh

    Actually Query is a dynamic query. Query length will exceeds if the no of domains\domain values \products exceeds. Any way Below one is current dynamic query, which is generated within procedure
    SELECT
      IVT.ID_IVT
        ,IVT.ID_INS_IVT
      ,EXTRACTVALUE(IVT.DOCUMENT_IVT,'//productName/text()') AS PRODUCTNAME
      ,EXTRACTVALUE(IVT.DOCUMENT_IVT,'//elementName/text()') AS INSTANCENAME
      ,EXTRACTVALUE(IVT.DOCUMENT_IVT,'//elementInternalName/text()') AS INTERNALNAME
        ,CTG.NAME_CTG
        ,CTR.NAME_CTR
        ,MDL.NAME_MDL
      ,IVT.REEDIT_FLAG_IVT
        FROM  VARIATION_IVT IVT INNER JOIN CATEGORY_CTG CTG ON CTG.ID_CTG=IVT.ID_CTG_IVT
      AND IVT.STATUS_IVT='Active' AND IVT.DELETE_FLAG_IVT=0 AND IVT.ID_PRJ_IVT=1
      AND  IVT.DOCUMENT_IVT.existsnode('.//domain[domainName="Jurisdictions" and (domainValue="Delhi" or domainValue="Bangladesh" or domainValue="Mumbai" or domainValue="India" or domainValue="Pakistan" or domainValue="Nepal" or domainValue="Maldives" or domainValue="Kolkata" or domainValue="Bhutan" or domainValue="Chennai" or domainValue="ALL")]')=1 AND  IVT.DOCUMENT_IVT.existsnode('.//domain[domainName="Channels" and (domainValue="Agents" or domainValue="SBI" or domainValue="Maruti" or domainValue="Direct" or domainValue="CitiFinancial" or domainValue="SCB" or domainValue="BankAssurance" or domainValue="CitiBank" or domainValue="Employees" or domainValue="GE" or domainValue="Brokers" or domainValue="Telemarketing" or domainValue="Agency" or domainValue="ALL")]')=1 AND  IVT.DOCUMENT_IVT.existsnode('.//domain[domainName="ModeofDelivery" and (domainValue="Walkin" or domainValue="Internet" or domainValue="ALL")]')=1 AND  IVT.DOCUMENT_IVT.existsnode('.//context[(productName="ALL" or productName="A009" or productName="A010" or productName="A046" or productName="AccidentShieldClassic" or productName="AccidentShieldOnline" or productName="AM01" or productName="AM02" or productName="AME_Cancellation" or productName="ARHG" or productName="ARPA" or productName="B003" or productName="B004" or productName="B007" or productName="B008" or productName="B009" or productName="B010" or productName="B012" or productName="B013" or productName="B015" or productName="B016" or productName="B017" or productName="BC04_PA" or productName="BC06_FDP" or productName="BC06_PA" or productName="BC09" or productName="BC10" or productName="BC12" or productName="BC13" or productName="BF03" or productName="BS01" or productName="BS02" or productName="C017" or productName="C035" or productName="C036" or productName="C037" or productName="C038" or productName="C040" or productName="C041" or productName="C041Gold" or productName="C041New" or productName="C045HomeContents" or productName="C048" or productName="C049" or productName="C054" or productName="C057" or productName="C060Building" or productName="C060Contents" or productName="C060FDP" or productName="C061Building" or productName="C061Contents" or productName="C062" or productName="C063" or productName="C067" or productName="C070" or productName="C072" or productName="C074" or productName="C077" or productName="C081" or productName="C082" or productName="C087" or productName="C088" or productName="CITIFOREVER" or productName="CITISECURE" or productName="CITICHILDPLAN" or productName="D001" or productName="DB01" or productName="DD01" or productName="DD02" or productName="DD03" or productName="DD04" or productName="DD09" or productName="DD10" or productName="E005" or productName="E011" or productName="E016" or productName="E020" or productName="E030" or productName="E034" or productName="E040" or productName="E041" or productName="E045HCP" or productName="E045HSP" or productName="E049" or productName="E049New" or productName="E052" or productName="E053" or productName="E054FDP" or productName="E055" or productName="E056" or productName="E057" or productName="E058" or productName="E061" or productName="E061BATCH" or productName="E062" or productName="E063" or productName="E064HCP" or productName="E064HSP" or productName="E066" or productName="E069" or productName="E073" or productName="E075" or productName="E076" or productName="E088" or productName="E090" or productName="E093A" or productName="E093B" or productName="E095" or productName="E099A" or productName="E099B" or productName="E106" or productName="E107" or productName="E110" or productName="E112" or productName="E114" or productName="E115" or productName="E116" or productName="F001" or productName="FamilyHealthInsurance" or productName="FamilyHospitalBenefits" or productName="FamilyHospitalisationCoverBenefit" or productName="G001" or productName="G002" or productName="HealthShieldOnline" or productName="Health_B005" or productName="Health_S057" or productName="HealthSheild" or productName="HealthWalkin" or productName="HomeContentOnline" or productName="HomeShieldOnline" or productName="HomeShieldWalkin" or productName="HospitalCashOnline" or productName="J001" or productName="J008" or productName="K001" or productName="KV02" or productName="LC03" or productName="ML01" or productName="MP02" or productName="MP03" or productName="MR01" or productName="O005" or productName="PO01" or productName="PO02" or productName="PO03" or productName="PO04" or productName="PO05" or productName="PO06" or productName="RR02" or productName="RR03" or productName="RR04" or productName="S006" or productName="S033" or productName="S049" or productName="S051" or productName="S054" or productName="S057" or productName="S060" or productName="S061" or productName="S065" or productName="S065TM" or productName="S068" or productName="S076" or productName="S077" or productName="S079" or productName="S080" or productName="S081" or productName="S084" or productName="S085" or productName="S086" or productName="S087" or productName="S088" or productName="S091" or productName="S092" or productName="S093" or productName="S094" or productName="S095" or productName="S097" or productName="S098" or productName="S099" or productName="S100" or productName="S101" or productName="S102" or productName="S103" or productName="S104" or productName="S106" or productName="S107" or productName="S108" or productName="S109" or productName="S110" or productName="S111" or productName="S113" or productName="SCBNAC" or productName="SF02" or productName="SS01" or productName="SS02" or productName="SUNFHM" or productName="SurgicalShield" or productName="TD01" or productName="TD02" or productName="TP01" or productName="U002Building" or productName="U002Contents" or productName="U004Building" or productName="U007" or productName="U009" or productName="U013" or productName="U014" or productName="U015" or productName="U016" or productName="V001" or productName="V002" or productName="V005" or productName="V006" or productName="V008" or productName="W008" or productName="W020" or productName="W021" or productName="W022" or productName="W023" or productName="W024" or productName="W026" or productName="W027" or productName="W028" or productName="W029" or productName="W105" or productName="W106" or productName="WI01" or productName="WI02" or productName="WI03" or productName="WI07" or productName="WI08" or productName="WI09" or productName="WI10" or productName="WI11" or productName="WI12" or productName="WI13" or productName="WI14" or productName="WI17" or productName="WI20" or productName="WI21" or productName="WI21_Health" or productName="WI23" or productName="WI24" or productName="WI26" or productName="WI30" or productName="WI31" or productName="WI33" or productName="WI34" or productName="X001" or productName="X002" or productName="X003" or productName="X004" or productName="X005" or productName="X008" or productName="Y001" or productName="Y007" or productName="Y009" or productName="Y010" or productName="Y011" or productName="Y011H" or productName="Y020" or productName="Y020N" or productName="Z008" or productName="ZI001")]')=1
      INNER JOIN CENTER_CTR CTR ON CTR.ID_CTR=CTG.ID_CTR_CTG
        INNER JOIN MODEL_MDL MDL ON  MDL.ID_MDL=CTR.ID_MDL_CTR

  • Query regarding Handling Unicode characters in XML

    All,
    My application reads a flat file in series of bytes, I
    create a XMl document out of the data. The data contains Unicode characters.
    I use a XSLT to create XML file. While creating it I don't face any issues
    but later if I try to parse the constructed XMl file, i get a sax parsing exception
    (Caused by: org.xml.sax.SAXParseException: Character reference _"<not visible clearly in Browser>"_ is an invalid XML character.)
    Can some one advice on how to tackle this.
    regards,
    D
    Edited by: user9165249 on 07-Jan-2011 08:10

    How to tackle it? Don't allow your transformation to produce characters which are invalid in XML. The XML Recommendation specifies what characters are allowed and what characters aren't, in section 2.2: http://www.w3.org/TR/REC-xml/#charsets. The invalid characters can't come from the XML which you are transforming so they must be coming from code in your transformation.
    And if you can't tell what the invalid characters are by using your browser, then send the result of the transformation to a file and use a hex editor to examine it.
    By the way, this isn't a question about Unicode characters in XML, since all characters in Java are Unicode and XML is defined in terms of Unicode. So saying that your data contains Unicode characters is a tautology. It couldn't do anything else. If your personal definition of Unicode is "weird stuff that I don't understand" then do yourself a favour, take a couple of days out and learn what Unicode is.

  • Initialising strings with unicode characters

    This works
    System.out.println("Hello World");
    but this will not compile
    System.out.println("&#20320;&#22909;");
    How do I get unicode characters into my Java source?
    I am running Windows XP and editing my files using notepad.
    If I save my source as ASCII it compiles, but I do not get the foreign characters.
    If I save my file as utf-8 or unicode the source will not compile.

    I have got it!
    On Windows XP using notepad the java source file can be "saved as" Unicode.
    The source can then be compiled using;
    javac HelloWorld.java -encoding unicode
    The code compiles and executes.
    It is even possible to give variables names that are Chinese characters, which is really what you would expect to be able to do.

Maybe you are looking for

  • "Free" web form payment option giving error message

    Hello, On this page http://www.sedonamagoretreat.org/volunteer-retreat-test-page please see the form at the bottom of the page. The option to pay with a credit card works just fine. But if I select the "Free" payment option and click the Submit butto

  • Can't start imported VirtualBox appliance on Arch host with errors

    (I have been referred here from this thread in the VirtualBox forums because it is suspected that the problem is Arch-specific) I've installed latest VirtualBox 4.0.4 via pacman in a fully updated Arch Linux system. Then, I successfully imported the

  • AP 1140 DHCP Issue

    Hi All I am installing a 3750 switch with integrated controller and 12 x Cisco 1140 AP's. I have configured the 3750 WLC with a management and AP Manager IP address along with 3 WLAN profiles and security settings. I am confident that these are corre

  • Exposé forgetting settings on MacBook Pro

    My MacBook Pro keeps forgetting my settings for expose (the default settings, F11 -> desktop F12 -> dashboard). I'll set them and after a while, I'll go back to the system preferences and it will show nothing set for the expose keys. I'm guessing thi

  • ACS v5.5 authorization rules 320 limit

    I am about embark on a large service provider ACS migration / installation and I suspect I am going to need more than 320 authorization rules, which is the limit stated in ACS v5.5 release notes. Is the limit for the maximum number of rules for an Ac