Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


Geeta
Unicode
1 Answer(s)      5 years ago
Posted in : Java Beginners



Advertisement
View Answers

September 1, 2009 at 12:11 PM


Hi Friend,

Try the following code:

import java.io.*;
import java.util.*;

public class Unicode {
public static void main(String[] args) {
System.out.println("Enter character");
Scanner input=new Scanner(System.in);

try {
String line=input.nextLine();
for (int index = 0; index < line.length(); index++) {
String hexCode = Integer.toHexString(line.codePointAt(index)).toUpperCase();
String hexCodeWithAllLeadingZeros = "0000" + hexCode;
String hexCodeWithLeadingZeros = hexCodeWithAllLeadingZeros.substring(hexCodeWithAllLeadingZeros.length()-4);
System.out.println("\\u" + hexCodeWithLeadingZeros);
}
} catch (Exception e) {}
}
}

Thanks


Related Tutorials/Questions & Answers:
Java Unicode
Java Unicode  To insert Unicode word into MySql database using Java
Java Unicode
Java Unicode  To insert Unicode word into MySql database using Java
Advertisements
unicode characters
unicode characters  class Unicode { public static void main(String args[]) { char ch='\000a'; System.out.println("ch is:"+ch); } } on compilation this gives following errore:: CharLiteral6.java:5: error: illegal line end
unicode characters
unicode characters  class Unicode { public static void main(String args[]) { char ch='\000a'; System.out.println("ch is:"+ch); } } on compilation this gives following errore:: CharLiteral6.java:5: error: illegal line end
unicode characters
unicode characters  class Unicode { public static void main(String args[]) { char ch='\000a'; System.out.println("ch is:"+ch); } } on compilation this gives following errore:: CharLiteral6.java:5: error: illegal line end
Unicode - JDBC
Unicode  hi i wanna retrieve Unicode values from the database........when i do so and print the fetched values in java control (JTextArea) or IN doc or RTF or WEB page it get the UNICODE as ????? what can i do so
unicode handling in java
unicode handling in java  reading a unicode text file in java
PDF Generation for unicode characters
PDF Generation for unicode characters  Hi, How a PDF file having unicode characters is generated in JSP
unicode - Swing AWT
unicode  hi i wanna retrieve Unicode values from the database........when i do so and print the fetched values in java control (JTextArea) or IN doc or RTF or WEB page it get the UNICODE as ????? what can i do so
SQL or UNICODE - SQL
SQL or UNICODE   Hi again............ I have got something new... ASCII and other With UNICODE 1] when i trying to pass parameter to database i.e UNICODE and fetches ASCII it retrieves nothing to display 2] when trying
Java: Unicode
Java: Unicode Unicode is a system of encoding characters. All characters and Strings in Java use the Unicode encoding, which allows truly international programming. About Unicode The Unicode effort is not coordinated with Java
Java unicode - Java Beginners
Java unicode  I can read unicode character(malayalam language character) from a file but not able to print the character without installing a malayalam font(corresponding language font). Please help me to solve
Unicode - Java Beginners
Unicode  How to print unicode value of a char. Eg. /u0000 on console(default value of a char)  Hi Friend, Try the following code: import java.io.*; import java.util.*; public class Unicode { public static
Prinnt UNICODE character on swing component
Prinnt UNICODE character on swing component  Hello, I am trying to put unicode character n swing component. can anyone tell me how to do this? Thank you
How java work on Unicode machanish
How java work on Unicode machanish   How the data are stored in java as unicode, how the conversions is done for input/output stream. Please describe in detail with memory aspect
UNICODE or SQL statement issue - JDBC
UNICODE or SQL statement issue  Hi again............ I have got... with having ASCII and other With UNICODE 1] when i trying to pass parameter to database i.e UNICODE and fetches ASCII it retrieves nothing to display 2
Conversion of unicode to its corresponding character
Conversion of unicode to its corresponding character  i have a string of unicodes e.g String s="\c0059\c0049\c3000" .. i need code for converting these unicodes to its corresponding alphabets.. pls if possible rep asap as i need
Using Unicode Variable Names - Java Tutorials
Using Unicode Variable Names 2001-11-23 The Java Specialists' Newsletter [Issue 036] - Using Unicode Variable Names Author: Dr. Heinz M. Kabutz...". This week, we will look at the strange things that happen when we try to use unicode
unicode support in javascript - JSP-Servlet
unicode support in javascript  We are facing problem while editing the tha text in a text box and sending it to next jsp. we are using UTF-8 encoding for jsp and charset as windows-874 for html meta charset. Can anybody help me
Convert String to unicode and ascii
Description: This example demonstrate how to convert the general string to unicode and ascii type Code: import java.net.IDN...; + unicode);   } } Output
How to get the unicode of chinese character input in j2me/java
How to get the unicode of chinese character input in j2me/java  Hi All, How to get the Unicode of a chinese character either in j2me or Java? Please provide the sample code snippet for the above ? Thanks in advance... Thanks
How to get the unicode of japanese character input in java
How to get the unicode of japanese character input in java  Good... the text into japanese that needS to be converted as a unicode. for that I need a function,method or something through which i can get the unicode of japanese
unicode conversion to its actual text format
unicode conversion to its actual text format  hi, i am saving the hindi text into the database. It is saving in db as "हिन्डि". But while fetching i am not able to fetch the same hindi text
Generate unicode malayalam PDF from JSP
Generate unicode malayalam PDF from JSP   Hi, I want to generate... the same report to be saved as PDF in unicode malayalam font.I have tried to generate PDF reports using IText,but I dont know how to generate unicode malayalam
Determining the Word Boundaries in a Unicode String
Determining the Word Boundaries in a Unicode String In this section, you will learn how to determine the word boundaries in a unicode string. Generally, we use split() method and StringTokenizer class to break the string into words
Determining the Sentence Boundaries in a Unicode String
Determining the Sentence Boundaries in a Unicode String In this section, you will learn how to determine the sentence boundaries in a unicode string. From the previous section, you all are aware of BreakIterator class. This class
String Determining a Character's Unicode Block
String Determining a Character's Unicode Block   ... in the example we have taken a Unicode of a character. Then we have applied a method... the following output. Similarly, we can take other Unicode as well for different
Set Sheet Name Compressed Unicode
Set Sheet Name Compressed Unicode   ...; This method is deprecated. In POI 3.0, now automatically detects unicode and sets... detects Unicode and sets the encoding appropriately. Simply use setSheetName(int
Compressed Unicode in Excel Using POI3.0
Compressed Unicode in Excel Using POI3.0  ...; This method is deprecated. In POI 3.0, now automatically detects unicode... automatically detects Unicode and sets the encoding appropriately. Simply use setSheetName
Determining the Character Boundaries in a Unicode String
Determining the Character Boundaries in a Unicode String In this section,  you will learn how to determine the character boundaries in a string. By determining the character boundaries, you will be able to break the string
Determining Potential Line Breaks in a Unicode String
Determining Potential Line Breaks in a Unicode String This section illustrates you how to use the BreakIterator to parse a string on a line break. Parsing a text is a common task. Through the use of BreakIterator class, you can perform
JavaScript method fromCharCode()
sequence of Unicode character values.  Its Syntax... of Unicode character values. This method is a static method of String and cannot... example, we have used this method which translate the specified sequence of Unicode
Java basics - Java Beginners
Java basics - Java Beginners  What is UNICODE?  Unicode is a system of encoding characters. Most of the world's writing systems, characters and Strings in Java use the Unicode encoding.Each Unicode character is defined
Java - Java Beginners
Java unicode example  Can anyone give me the simple Java Unicode example
jsp
jsp  how to write hindi in jsp and store in database as unicode
converter - Java Beginners
converter  how can convert hindi character to unicode entity
Java code - Java Beginners
Java code  Is there any function to find unicode for a particular character?  public class unicode{ public static void main(String[] args) { char ch='a'; System.out.println(ch+" Unicode = "+((int)ch)); char
java - Java Beginners
java  i am unable to read unicode characters from the html file,can u give the sample code how to read the unicode characters from the html file
Character Wrapper Class.
Character Wrapper Class.  what are Mirrored Unicode Characters.....!!   Unicode is capable of representing many languages, including those.... There are special characters in UNICODE to achieve the RTL. Such character is the Mirroring
Java characters
Java characters  How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters
Generating pdf in Spring
Generating pdf in Spring  Sir/Madam, I need your help in generating a pdf by fetching the data form database and by using unicode in spring framework
jav
jav  i need to search word from a unicode txt file using java netbeans can someone help me with some code
mysql doubt
mysql doubt  1.What are the method to write malayalam in mysql command prompt?Is it necessary to write malayalam corressponding unicode in mysql command prompt? 2.How to store & retrieve Malayalam from mysql databases
crystal report plugin for eclipse
crystal report plugin for eclipse  Hi, I want to know whether unicode based crystal reports can be generated using jsp.?Also I need the crystal report plugin for eclipse . Thanks
urgent - JSP-Servlet
urgent  list the various encoding formats supported by client browser.  Hi Friend, 1)URL Encoding 2)Unicode Encoding 3)Hex Encoding Thanks
 

 

 

DMCA.com