[Mono-list] conversions

Polton, Richard (IT) Richard.Polton@morganstanley.com
Tue, 5 Oct 2004 09:34:13 +0100


 In fact, habing given it further thought, I have a couple of questions:

i) if I sit at a Japanese terminal (for example) and enter '-', i.e.
ichi or 'one', is this a valid Unicode character?
ii) how wide is the 'char' datatype? I assume it contains Unicode rather
than single-byte ASCII.
iii) if entering 'ichi' is valid, and char contains Unicode, then I
suspect that the below subtration will return a number substantially
greater than one.

Richard

-----Original Message-----
From: mono-list-admin@lists.ximian.com
[mailto:mono-list-admin@lists.ximian.com] On Behalf Of Polton, Richard
(IT)
Sent: 29 September 2004 09:05
To: Jambunathan Jambunathan; mono-list@lists.ximian.com
Subject: RE: [Mono-list] conversions

Hi,

The code is in

mcs-1.0.1/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Conversion.c
s

at line 687

The particular piece I noticed is

return Expression - '0';

Richard

-----Original Message-----
From: Jambunathan Jambunathan [mailto:kjambunathan@novell.com]
Sent: 26 September 2004 14:31
To: mono-list@lists.ximian.com; Polton, Richard (IT)
Subject: Re: [Mono-list] conversions

Hey Richard

This is definitely odd.=20

Could you point us to the offending code or better still could you
please submit a test report in bugzilla with a test case.

Regards,
Jambunathan  K.

>>> Richard Polton <Richard.Polton@morganstanley.com> 09/24/04 4:04 PM
>>>
Hi,

I was browsing the source code for Conversions.cs (or similar) in the
VisualBasic (I think) package in 1.0.1 and came across a couple of
oddities. The one which struck me in particular was the conversion of a

single character into a numeric type. It was performed by subtracting
the absolute character '0' from the function parameter. This will only

work if the input character set is known to be ASCII or known to be
ordered in the same way? So, my question is, is it a requirement of all

.NET (and Mono) applications that the character set used is ASCII or
similar? I know the spec refers to the program as being encoded in
Unicode but I couldn't find anything regarding the recognisable input
chars.

Richard
_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list
--------------------------------------------------------
=20
NOTICE: If received in error, please destroy and notify sender.  Sender
does not waive confidentiality or privilege, and use is prohibited.=20
=20
_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list=20
--------------------------------------------------------
=20
NOTICE: If received in error, please destroy and notify sender.  Sender =
does not waive confidentiality or privilege, and use is prohibited.=20
=20