Unicode

Unicode

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 - 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 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 handling in java
unicode handling in java  reading a unicode text file in java
unicode
unicode
PDF Generation for unicode characters
PDF Generation for unicode characters  Hi, How a PDF file having unicode characters is generated in JSP
ModuleNotFoundError: No module named 'unicode'
ModuleNotFoundError: No module named 'unicode'  Hi, My Python... 'unicode' How to remove the ModuleNotFoundError: No module named 'unicode... to install padas library. You can install unicode python with following command
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 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
Version of com.globalmentor>globalmentor-unicode dependency
List of Version of com.globalmentor>globalmentor-unicode dependency
ModuleNotFoundError: No module named 'docopt-unicode'
ModuleNotFoundError: No module named 'docopt-unicode'  Hi, My... named 'docopt-unicode' How to remove the ModuleNotFoundError: No module named 'docopt-unicode' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'emoji-unicode'
ModuleNotFoundError: No module named 'emoji-unicode'  Hi, My... 'emoji-unicode' How to remove the ModuleNotFoundError: No module named 'emoji-unicode' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'font-unicode'
ModuleNotFoundError: No module named 'font-unicode'  Hi, My Python... 'font-unicode' How to remove the ModuleNotFoundError: No module named 'font-unicode' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'pyjavaproperties-unicode'
ModuleNotFoundError: No module named 'pyjavaproperties-unicode'  Hi...: No module named 'pyjavaproperties-unicode' How to remove the ModuleNotFoundError: No module named 'pyjavaproperties-unicode' error? Thanks  
ModuleNotFoundError: No module named 'unicode-babel'
ModuleNotFoundError: No module named 'unicode-babel'  Hi, My... 'unicode-babel' How to remove the ModuleNotFoundError: No module named 'unicode-babel' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'unicode-charnames'
ModuleNotFoundError: No module named 'unicode-charnames'  Hi, My... named 'unicode-charnames' How to remove the ModuleNotFoundError: No module named 'unicode-charnames' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'unicode_ids'
ModuleNotFoundError: No module named 'unicode_ids'  Hi, My Python... 'unicode_ids' How to remove the ModuleNotFoundError: No module named 'unicode_ids' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'unicode-mayo'
ModuleNotFoundError: No module named 'unicode-mayo'  Hi, My Python... 'unicode-mayo' How to remove the ModuleNotFoundError: No module named 'unicode-mayo' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'unicode-nazi'
ModuleNotFoundError: No module named 'unicode-nazi'  Hi, My Python... 'unicode-nazi' How to remove the ModuleNotFoundError: No module named 'unicode-nazi' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'unicode-please'
ModuleNotFoundError: No module named 'unicode-please'  Hi, My... named 'unicode-please' How to remove the ModuleNotFoundError: No module named 'unicode-please' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'unicode-slugify'
ModuleNotFoundError: No module named 'unicode-slugify'  Hi, My... named 'unicode-slugify' How to remove the ModuleNotFoundError: No module named 'unicode-slugify' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'unicode_tex'
ModuleNotFoundError: No module named 'unicode_tex'  Hi, My Python... 'unicode_tex' How to remove the ModuleNotFoundError: No module named 'unicode_tex' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'unicode_tr'
ModuleNotFoundError: No module named 'unicode_tr'  Hi, My Python... 'unicode_tr' How to remove the ModuleNotFoundError: No module named 'unicode_tr' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'winreg_unicode'
ModuleNotFoundError: No module named 'winreg_unicode'  Hi, My... named 'winreg_unicode' How to remove the ModuleNotFoundError: No module named 'winreg_unicode' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'winreg_unicode'
ModuleNotFoundError: No module named 'winreg_unicode'  Hi, My... named 'winreg_unicode' How to remove the ModuleNotFoundError: No module named 'winreg_unicode' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'winreg_unicode'
ModuleNotFoundError: No module named 'winreg_unicode'  Hi, My... named 'winreg_unicode' How to remove the ModuleNotFoundError: No module named 'winreg_unicode' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'docopt-unicode'
ModuleNotFoundError: No module named 'docopt-unicode'  Hi, My... named 'docopt-unicode' How to remove the ModuleNotFoundError: No module named 'docopt-unicode' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'emoji-unicode'
ModuleNotFoundError: No module named 'emoji-unicode'  Hi, My... 'emoji-unicode' How to remove the ModuleNotFoundError: No module named 'emoji-unicode' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'font-unicode'
ModuleNotFoundError: No module named 'font-unicode'  Hi, My Python... 'font-unicode' How to remove the ModuleNotFoundError: No module named 'font-unicode' error? Thanks   Hi, In your python
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
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
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
ModuleNotFoundError: No module named 'doctest-ignore-unicode'
ModuleNotFoundError: No module named 'doctest-ignore-unicode'  Hi...: No module named 'doctest-ignore-unicode' How to remove the ModuleNotFoundError: No module named 'doctest-ignore-unicode' error? Thanks   Hi
ModuleNotFoundError: No module named 'normalize_cz_unicode'
ModuleNotFoundError: No module named 'normalize_cz_unicode'  Hi...: No module named 'normalize_cz_unicode' How to remove the ModuleNotFoundError: No module named 'normalize_cz_unicode' error? Thanks   Hi
ModuleNotFoundError: No module named 'normalize_cz_unicode'
ModuleNotFoundError: No module named 'normalize_cz_unicode'  Hi...: No module named 'normalize_cz_unicode' How to remove the ModuleNotFoundError: No module named 'normalize_cz_unicode' error? Thanks   Hi
ModuleNotFoundError: No module named 'tangled-up-in-unicode'
ModuleNotFoundError: No module named 'tangled-up-in-unicode'  Hi...: No module named 'tangled-up-in-unicode' How to remove the ModuleNotFoundError: No module named 'tangled-up-in-unicode' error? Thanks   Hi
ModuleNotFoundError: No module named 'tangled-up-in-unicode'
ModuleNotFoundError: No module named 'tangled-up-in-unicode'  Hi...: No module named 'tangled-up-in-unicode' How to remove the ModuleNotFoundError: No module named 'tangled-up-in-unicode' error? Thanks   Hi
ModuleNotFoundError: No module named 'unicode-slugify-latin'
ModuleNotFoundError: No module named 'unicode-slugify-latin'  Hi...: No module named 'unicode-slugify-latin' How to remove the ModuleNotFoundError: No module named 'unicode-slugify-latin' error? Thanks   Hi
ModuleNotFoundError: No module named 'unicode-string-literal'
ModuleNotFoundError: No module named 'unicode-string-literal'  Hi...: No module named 'unicode-string-literal' How to remove the ModuleNotFoundError: No module named 'unicode-string-literal' error? Thanks   Hi
ModuleNotFoundError: No module named 'win_unicode_console'
ModuleNotFoundError: No module named 'win_unicode_console'  Hi, My... named 'win_unicode_console' How to remove the ModuleNotFoundError: No module named 'win_unicode_console' error? Thanks   Hi
ModuleNotFoundError: No module named 'doctest-ignore-unicode'
ModuleNotFoundError: No module named 'doctest-ignore-unicode'  Hi...: No module named 'doctest-ignore-unicode' How to remove the ModuleNotFoundError: No module named 'doctest-ignore-unicode' error? Thanks   Hi
Maven Dependency globalmentor-unicode >> 0.5.0
You should include the dependency code given in this page to add Maven Dependency of com.globalmentor >> globalmentor-unicode version0.5.0 in your project
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

Ads