Objective :
The BlueJ Program of class PrintUnicode Prints the Unicode Of the character Inputted By the User. \\u is used to add to the End since \\ is the Escape Sequence for Printing \ . Using the Unsigned Right Bitwise Shift, The ASCII of the Character is converted to Unicode. The BlueJ Implementation of the Unicode is Easier with the Bitwise Right Shift Operator ( >>> ) which Automatically indents 0 to the Left During Shift. First Converted to Hexadecimal and then To the Unicode using while loop which iterates till n becomes 0.
What is Unicode ?
These encoding systems also conflict with one another. That is, two encodings can use the same number for two different characters, or use different numbers for the same character. Any given computer (especially servers) needs to support many different encodings; yet whenever data is passed between different encodings or platforms, that data always runs the risk of corruption.
Java Program Source Code :
The BlueJ Program of class PrintUnicode Prints the Unicode Of the character Inputted By the User. \\u is used to add to the End since \\ is the Escape Sequence for Printing \ . Using the Unsigned Right Bitwise Shift, The ASCII of the Character is converted to Unicode. The BlueJ Implementation of the Unicode is Easier with the Bitwise Right Shift Operator ( >>> ) which Automatically indents 0 to the Left During Shift. First Converted to Hexadecimal and then To the Unicode using while loop which iterates till n becomes 0.
What is Unicode ?
Unicode provides a unique number for every character,
no matter what the platform,
no matter what the program,
no matter what the language.
Fundamentally, computers just deal with numbers. They store letters and other characters by assigning a number for each one. Before Unicode was invented, there were hundreds of different encoding systems for assigning these numbers. No single encoding could contain enough characters: for example, the European Union alone requires several different encodings to cover all its languages. Even for a single language like English no single encoding was adequate for all the letters, punctuation, and technical symbols in common use.
Unicode is changing all that!
Unicode provides a unique number for every character, no matter what the platform, no matter what the program, no matter what the language.
The Unicode Standard has been adopted by such industry leaders as Apple, HP, IBM, JustSystems, Microsoft, Oracle, SAP, Sun, Sybase, Unisys and many others. Unicode is required by modern standards such as XML, Java, ECMAScript (JavaScript), LDAP, CORBA 3.0, WML, etc., and is the official way to implement ISO/IEC 10646. It is supported
in many operating systems, all modern browsers, and many other products.
The emergence of the Unicode Standard, and the availability of tools supporting it, are among the most significant recent global software technology trends.
Incorporating Unicode into client-server or multi-tiered applications and websites offers
significant cost savings over the use of legacy character sets. Unicode enables a single software product or a single website to be targeted across multiple platforms, languages and countries without re-engineering. It allows data to be transported through many different systems without corruption.
Java Program Source Code :
/** * The BlueJ Program of class PrintUnicode Prints the Unicode Of the character * Inputted By the User. \\u is used to add to the End since \\ is the Escape * Sequence for Printing \ . Using the Unsigned Right Bitwise Shift, The ASCII * of the Character is converted to Unicode. * @author Shouvik Mitra * @mail shouvikmitra1997@gmail.com * @website wcodes.blogspot.com * Program Type : BlueJ Program - Java */ import java.io.*; public class PrintUnicode { public static void main(String[] args)throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter a character : "); char c=br.readLine().charAt(0); PrintUnicode obj=new PrintUnicode(); obj.print(c); } public void print(Character c) { int n=c; String uni=new String(); while(n!=0) { int m=n&15; n>>>=4; if(m<10) { uni=m+uni; } else { uni=(char)('A'+m-10)+uni; } } while(uni.length()!=4) { uni='0'+uni; } System.out.print("The unicode of the character is \\u"+uni); } }
0 comments :
Post a Comment