You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Konstantin Kolinko <kk...@apache.org> on 2009/05/22 02:35:44 UTC

Coding Guidelines, encodings, keywords

Hi, all!

Are there any Coding Guidelines that we ought to follow,
or is our project on our own there?

I am interested in clarifying the following question:
What is the character encoding for our sources.

Our build scripts do not specify an explicit encoding yet,
and, as I heard, some months ago the build environment for our releases
changed from some western Windows to Linux with a locale using UTF-8 encoding.

I would like to draw your attention that there is such SVN keyword as $Date$,
that expands to UTF-8 string containing localized month and day of week names.

E.g.:
$Revision: 776947 $ $Date: 2009-05-21 08:33:21 +0400 (Чт, 21 май 2009) $

That makes the files that use that keyword de-facto UTF-8 on
non-English locales.

More on svn keywords:
http://svnbook.red-bean.com/nightly/en/svn.advanced.props.special.keywords.html

A workaround would be to either limit the string width (e.g. $Date::
2009-05-21 08:33:21 #$)
or to use $Id$ instead.

Do we officially acknowledge that the sources are UTF-8?

What explicit encoding should be specified in javac and javadoc tasks
in our build files?
ISO-8859-1 or UTF-8 ?


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Coding Guidelines, encodings, keywords

Posted by sebb <se...@gmail.com>.
On 22/05/2009, Konstantin Kolinko <kk...@apache.org> wrote:
> Hi, all!
>
>  Are there any Coding Guidelines that we ought to follow,
>  or is our project on our own there?
>
>  I am interested in clarifying the following question:
>  What is the character encoding for our sources.
>
>  Our build scripts do not specify an explicit encoding yet,
>  and, as I heard, some months ago the build environment for our releases
>  changed from some western Windows to Linux with a locale using UTF-8 encoding.
>
>  I would like to draw your attention that there is such SVN keyword as $Date$,
>  that expands to UTF-8 string containing localized month and day of week names.
>
>  E.g.:
>  $Revision: 776947 $ $Date: 2009-05-21 08:33:21 +0400 (Чт, 21 май 2009) $
>
>  That makes the files that use that keyword de-facto UTF-8 on
>  non-English locales.
>
>  More on svn keywords:
>  http://svnbook.red-bean.com/nightly/en/svn.advanced.props.special.keywords.html
>
>  A workaround would be to either limit the string width (e.g. $Date::
>  2009-05-21 08:33:21 #$)

Unfortunately that can still cause some problems, as the time (and
sometimes date) will vary for different users. For example it makes
checking source archives against SVN a bit of a chore.

>  or to use $Id$ instead.

That's much better, because it uses UTC.

>  Do we officially acknowledge that the sources are UTF-8?
>
>  What explicit encoding should be specified in javac and javadoc tasks
>  in our build files?
>  ISO-8859-1 or UTF-8 ?
>
>
>  Best regards,
>  Konstantin Kolinko
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>  For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Coding Guidelines, encodings, keywords

Posted by Mark Thomas <ma...@apache.org>.
Konstantin Kolinko wrote:
> Hi, all!
> 
> Are there any Coding Guidelines that we ought to follow,
> or is our project on our own there?
> 
> I am interested in clarifying the following question:
> What is the character encoding for our sources.

I always worked on the basis it is ISO-8859-1.

> Our build scripts do not specify an explicit encoding yet,
> and, as I heard, some months ago the build environment for our releases
> changed from some western Windows to Linux with a locale using UTF-8 encoding.
> 
> I would like to draw your attention that there is such SVN keyword as $Date$,
> that expands to UTF-8 string containing localized month and day of week names.
> 
> E.g.:
> $Revision: 776947 $ $Date: 2009-05-21 08:33:21 +0400 (Чт, 21 май 2009) $

That will probably cause a few issues. It might explain a bugzilla entry
or two as well.

> That makes the files that use that keyword de-facto UTF-8 on
> non-English locales.

I think that is bad.

> More on svn keywords:
> http://svnbook.red-bean.com/nightly/en/svn.advanced.props.special.keywords.html
> 
> A workaround would be to either limit the string width (e.g. $Date::
> 2009-05-21 08:33:21 #$)
> or to use $Id$ instead.

I'd like to get rid of the use of svn keywords entirely. I don't feel
they add a great deal. If there isn't consensus for that, then at least
lets switch to $Id:$ instead.

> Do we officially acknowledge that the sources are UTF-8?
> 
> What explicit encoding should be specified in javac and javadoc tasks
> in our build files?
> ISO-8859-1 or UTF-8 ?

+1 for IS0-8859-1

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Coding Guidelines, encodings, keywords

Posted by Mark Thomas <ma...@apache.org>.
Leon Rosenberg wrote:
> 2009/5/22 Filip Hanik - Dev Lists <de...@hanik.com>:
>> Konstantin Kolinko wrote:
>>> Hi, all!
>>>
>>> Are there any Coding Guidelines that we ought to follow,
>>> or is our project on our own there?
>>>
>> spaces instead of tabs :)
> 
> Wow,
> "Are there really people out there who still use spaces? "
> seems so.
> Without offending anyone, I would like to ask "why?".
> Are you coding with vi?
> 
> Really intrigued...

Because difference editors expand tabs different amounts and it messes
up the indenting, particularly if you have mixed tabs/spaces. Tomcat
convention is an indent is 4 spaces.

Mark

> Leon
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Coding Guidelines, encodings, keywords

Posted by Leon Rosenberg <ro...@googlemail.com>.
On Fri, May 22, 2009 at 4:12 PM, Filip Hanik - Dev Lists
<de...@hanik.com> wrote:
> Leon Rosenberg wrote:
>>
>> 2009/5/22 Filip Hanik - Dev Lists <de...@hanik.com>:
>>
>>>
>>> Konstantin Kolinko wrote:
>>>
>>>>
>>>> Hi, all!
>>>>
>>>> Are there any Coding Guidelines that we ought to follow,
>>>> or is our project on our own there?
>>>>
>>>>
>>>
>>> spaces instead of tabs :)
>>>
>>
>> Wow,
>> "Are there really people out there who still use spaces? "
>> seems so.
>>
>
> tabs is the eclipse default :)

yeah, and tabs are so much better than spaces, set the ident to what
you want and don't bother what others want...
:-)
Leon

P.S. checkstyle seem to like tabs more too :-)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Coding Guidelines, encodings, keywords

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
Leon Rosenberg wrote:
> 2009/5/22 Filip Hanik - Dev Lists <de...@hanik.com>:
>   
>> Konstantin Kolinko wrote:
>>     
>>> Hi, all!
>>>
>>> Are there any Coding Guidelines that we ought to follow,
>>> or is our project on our own there?
>>>
>>>       
>> spaces instead of tabs :)
>>     
>
> Wow,
> "Are there really people out there who still use spaces? "
> seems so.
>   
tabs is the eclipse default :)


> Without offending anyone, I would like to ask "why?".
> Are you coding with vi?
>
> Really intrigued...
> Leon
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Coding Guidelines, encodings, keywords

Posted by Leon Rosenberg <ro...@googlemail.com>.
2009/5/22 Filip Hanik - Dev Lists <de...@hanik.com>:
> Konstantin Kolinko wrote:
>>
>> Hi, all!
>>
>> Are there any Coding Guidelines that we ought to follow,
>> or is our project on our own there?
>>
>
> spaces instead of tabs :)

Wow,
"Are there really people out there who still use spaces? "
seems so.
Without offending anyone, I would like to ask "why?".
Are you coding with vi?

Really intrigued...
Leon

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Coding Guidelines, encodings, keywords

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
Konstantin Kolinko wrote:
> Hi, all!
>
> Are there any Coding Guidelines that we ought to follow,
> or is our project on our own there?
>   
spaces instead of tabs :)

> I am interested in clarifying the following question:
> What is the character encoding for our sources.
>
> Our build scripts do not specify an explicit encoding yet,
> and, as I heard, some months ago the build environment for our releases
> changed from some western Windows to Linux with a locale using UTF-8 encoding.
>
> I would like to draw your attention that there is such SVN keyword as $Date$,
> that expands to UTF-8 string containing localized month and day of week names.
>
> E.g.:
> $Revision: 776947 $ $Date: 2009-05-21 08:33:21 +0400 (Чт, 21 май 2009) $
>
> That makes the files that use that keyword de-facto UTF-8 on
> non-English locales.
>
> More on svn keywords:
> http://svnbook.red-bean.com/nightly/en/svn.advanced.props.special.keywords.html
>
> A workaround would be to either limit the string width (e.g. $Date::
> 2009-05-21 08:33:21 #$)
> or to use $Id$ instead.
>
> Do we officially acknowledge that the sources are UTF-8?
>
> What explicit encoding should be specified in javac and javadoc tasks
> in our build files?
> ISO-8859-1 or UTF-8 ?
>
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org