users
[Top] [All Lists]

Re: [cinjug-users] Unicode in comments?

To: esumerfd@xxxxxxxxxxxxxx, CinJug <users@xxxxxxxxxx>
Subject: Re: [cinjug-users] Unicode in comments?
From: Abdul Habra <ahabra@xxxxxxxxx>
Date: Wed, 24 Oct 2007 15:22:23 -0700 (PDT)
Delivered-to: mailing list users@xxxxxxxxxx
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=IG3uqOHcgDwTSGbWhd+47+QF6AfmdPgt/M5IJyTG7djjlljR2DSXoa9Gj7Pp3OBcf2i+AxLwhPkJkQwy4yzSYKKvKRdcFDdz8id9blEXiS4zu/058exl36vIGpQ7pSW4FGps42b38ItPBVo8ZjODg0V/VyzR1+gOi9PTsIY96IA=;
In-reply-to: <6a216ba20710241403u2f6e1fb3p16696b82517bc21b@xxxxxxxxxxxxxx>
Mailing-list: contact users-help@xxxxxxxxxx; run by ezmlm
if you use \\ublah it will escape the \
but I am not sure how would you do it with clearCase.
 
the \u unicode feature is well documented in java, you can write a whole obfuscated program with \u... chars, this was a trick question when I was learning java long time ago in 1870 :)

Edward Sumerfield <esumerfd@xxxxxxxxxxxxxx> wrote:
Wow lots of questions this week. I have never seen this before.

/*
 * This is not a valid character \u sequence in a comment
 */
class HelloWorld
{
    // What about in this comment \u
    public static void main(String[] a_args)
    {
        System.out.println("Hello world");
    }
}

This source does not compile in 1.5.0_12 complaining of:

: javac HelloWorld.java
HelloWorld.java:2: illegal unicode escape
 * This is not a valid character \u sequence in a comment
                                 ^
HelloWorld.java:6: illegal unicode escape
    // What about in this comment \u
                                  ^
2 errors

The reason this is a problem is that one of my packages is called "ui" and I have the source control variable replacement thing going on so when the file is retrieved from, in this case ClearCase, the xx\yy \ui\zz package name is expanded and appears with an apparent invalid unicode character.

So we can not have a package or class name beginning with "u"?

--
Ed

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

<Prev in Thread] Current Thread [Next in Thread>