Wrox Programmer Forums
|
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 18th, 2003, 06:34 AM
Authorized User
 
Join Date: Dec 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kaizer Send a message via Yahoo to kaizer
Default unicode howto..

hello people,

On page 62 of Mr. Horton's book, he talks about the unicode characterset. I've listed below my attempt to print out the unicode character set on my console. What it does is to initialize a variable c of type char to '\u0000'. I also set up a counter of type int that goes up to 4999 starting from 0. In the for() loop, i print the value of c and increment it in the very next line.

Here's the code..

public class cha
{
        public static void main(String[] args)
        {
                char c = '\u0000' // I want c to hold the unicode value
                int count = 0;
                for(; count < 5000; count++)
                {
                        System.out.print( c + " ");
                        c++;
                }
        }
}



however, all i get are a few characters (which i now suspect are ASCII in nature) followed by '?' marks. What's with the program? What am i doing wrong? Or am i doing something that inherently can't be done?

Thanks in advance for your inputs!

Kaizer.

Kaizer Billimoria
Bangalore, India
__________________
Kaizer Billimoria
Bangalore, India
 
Old December 18th, 2003, 10:41 AM
Authorized User
 
Join Date: Sep 2003
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Today I saw a wonderful book called Unicode 4.0. It refered to their website, I think you should find it through Google. There all the characters should be listed, and also the way to implement them (through Java) on your system. You could also search out the Sun website, how they aproach the Unicode.
Naturally your system (and the systems of the people you send your Applets) would have to be informed beforehand about the Unicode you want to use.

If you worked it all out, could you please here reply if you find that the Hindi (Devanagari) characters are adequately covered by the Unicode character set. I mean: beside the Devanagari alphabet you have all these composite letter signs (kr, st, etc.), and I cannot imagine them all being part of the Unicode set.

They have Bengali for you too, and other Indian languages!

Good luck and let us know!!!

Frans
Holland

Quote:
quote:Originally posted by kaizer
 hello people,

On page 62 of Mr. Horton's book, he talks about the unicode characterset. I've listed below my attempt to print out the unicode character set on my console.

however, all i get are a few characters (which i now suspect are ASCII in nature) followed by '?' marks. What's with the program? What am i doing wrong? Or am i doing something that inherently can't be done?

Thanks in advance for your inputs!

Kaizer.

Kaizer Billimoria
Bangalore, India
 
Old December 19th, 2003, 11:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It appears that you are encountering a code page problem. The output that you see is dependent upon the underlaying code page of the operating system that you are using. The following URL explains this in more detail than I could:

http://www.javajunkies.org/index.pl?...1&node_id=2821

Cheers

Martyn
 
Old December 19th, 2003, 11:19 PM
Authorized User
 
Join Date: Dec 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kaizer Send a message via Yahoo to kaizer
Default

Thanks Martyn,

Kaizer.


Kaizer Billimoria
Bangalore, India





Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto Serialize System.Exception? jacob C# 3 November 6th, 2006 12:12 PM
howto test document exists folklayer XSLT 2 October 19th, 2005 05:56 PM
Howto create Distribution list Alcapone C# 1 November 1st, 2004 06:25 AM
howto create sybase dsn ? qwjunk Access 0 August 24th, 2004 09:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.