[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

=?utf-8?B?VW5pY29kZSBpcyB1bml2ZXJzYWwsIHNvIGhvdyBjb21lIHRoYXQgdW5pdmVy?=

  • From: Roger L Costello <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Wed, 16 Dec 2020 13:49:16 +0000

=?utf-8?B?VW5pY29kZSBpcyB1bml2ZXJzYWwsIHNvIGhvdyBjb21lIHRoYXQgdW5pdmVy?=

Hi Folks,

Unicode make it possible to write things in different languages.

For example, rather than this XML:

<Number_Students>42</Number_Students>

a Bengali-speaking person can write this:

<সংখ্যা_ছাত্র>42</সংখ্যা_ছাত্র>

Or, in a programming language, rather than this assignment statement:

              Number_Students = 42

a Bengali-speaking person can write this:

              সংখ্যা_ছাত্র = 42

That’s awesome.

But, but, but, … how come that universality doesn’t extend to digits?

How come we can only use these digits: 0 (hex 30), 1 (hex 31), …, 9 (hex 39)?

Why, for example, can’t a Bengali-speaking person use the Bengali digits: Bengali digit 0 (U+09E6), Bengali digit 1 (U+09E7), …, Bengali digit 9 (U+09EF)?

Why, for example, can’t a Bengali-speaking person create XML such as this:

<সংখ্যা_ছাত্র></সংখ্যা_ছাত্র>

or write a program assignment statement like this:

              সংখ্যা_ছাত্র =

Let me explain why I assert that the Bengali-speaking person “cannot” do that.

Numbers in an XML document or in a program are just strings and, to perform arithmetic operations on them, those string numbers must be converted to actual numbers. I looked at the source code for the C function (strtol) that converts strings to numbers and here is the key to how it converts a character digit to a number digit:

              digit_number = digit_character - '0’

Yikes!

That generates a number digit by treating the character digit as a number and subtracting the number corresponding to the character ‘0’. For example, if the character digit is ‘4’ (hex 34) then when we subtract ‘0’ (hex 30) we get the number 4. Perfect! But ……… only if we allow European digits (0, 1, …, 9). Clearly, if we were to subtract ‘0’ (hex 30) from the Bengali digit 4 we do not get the number 4.

Thus I conclude:

  • When expressing numbers, the only digits that can be used are the European digits
  • Unicode is universal, but that universality does not apply to digits or numbers

Obviously I am not understanding something correctly. Please help me to understand.

/Roger



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.