This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Unicode character Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic

Unicode character

Jose Cao

Joined: Nov 06, 2002
Posts: 5
I have the following code:
1 public static String leer(BufferedReader sin) {
2 StringBuffer line = new StringBuffer();
4 try {
6 for (int ch; (ch = != 1; ){
7 line.append(ch);
8 }
10 } catch (IOException e) {
11 System.out.println("leer: " + e.toString());
12 }
13 if (linea != null)
14 System.out.println(line.substring(0));
15 return line.substring(0);
16 }
The problem is, at line 6, "" returns a int (which is a unicode code) and I need the equivalent character to build a string. How can I obtain the character that corresponds to this unicode code?
Thanks in advance.
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Please don't cross post!!!
follow the thread here

I agree. Here's the link:
subject: Unicode character
Similar Threads
Index of the last character of Strings
Filter Non-Standard Characters
Unicode characters
Unicode character
who can get the simplest code?