utf32 support

2024-04-05 Thread John Howard
---

testsuites/samples/utf32/utf32.h | 45 +-

1 file changed, 45 insertions(+), 0 deletion(-)

create mode 100644 testsuites/samples/utf32/utf32.h



diff --git a/testsuites/samples/utf32/utf32.h b/testsuites/samples/utf32/utf32.h

index 83f6342ab3..5ebcdc9ef2 100644

--- /dev/null

+++ b/testsuites/samples/utf32/utf32.h

@@ -0,0 +1,45 @@

+/*

+ Copyright 2024 John Howard

+ All Rights Reserved.

+ CUBITS is a trademark of John Howard.

+ CUBITS means Capital, Underline, Bold, Italic, Texture, and Strike.

+

+ This file is part of the RTEMS.org test suites samples.

+

+ Permission to use, copy, modify, and/or distribute this software for any

+ purpose with or without fee is hereby granted, provided that the above

+ copyright notice and this permission notice appear in all copies.

+

+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF

+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR

+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES

+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN

+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF

+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

+*/

+

+/* Unicode & ISO 10646-2012 character ranges 0..\U. */

+typedef int utf32;

+

+/* Convert UTF32 Big Endian and Little Endian v ranges 0..0x. */

+#define CONVERT_(v) v) & 255) << 24) | v) >> 8) & 255) << 16) | \

+   v) >> 16) & 255) << 8) | (((v) >> 24) & 255))

+

+/* Set zero-based nth bit of v ranges 0..0x. n ranges 0..31. */

+#define SETBIT_(v,n) ((v) |= (1 << (n)))

+

+/* Unset zero-based nth bit of v ranges 0..0x. n ranges 0..31. */

+#define UNSETBIT_(v,n) ((v) &= ~(1 << (n)))

+

+/* Test zero-based nth bit of v ranges 0..0x. n ranges 0..31. */

+#define TESTBIT_(v,n) (((v) & (1 << (n))) != 0)

+

+/* Unicode & ISO 10646-2012 codepoint v ranges 0..0x10. */

+#define CODEPOINT_(v) ((v) &= 0x1F; (((v) > 0x10) ? ((v) & 0x) : 
(v))

+

+/* CUBITS model: VGA, CGA, Custom, Texture, Cloudy, Glory, Shiny, Fiery. */

+#define SETMODEL_(v,m) ((v) |= ((m) << 21))

+

+/* CUBITS Texture ranges 0..255: VGA color index, CGA text attributes. */

+#define SETTEXTURE_(v,m) ((v) |= ((m) << 24))

-- 

2.42.0

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: utf32 support

2024-03-20 Thread Frank Kühndel

Hello John,

On 3/19/24 16:53, John Howard wrote:

P.S.: UTF32 exists for Unicode in 2012 after consolidation from ISO 10646-2012. 
The two standards merged.


Oops. I am apparently outdated ...
Frank

--
embedded brains GmbH & Co. KG
Herr Frank KÜHNDEL
Dornierstr. 4
82178 Puchheim
Germany
email: frank.kuehn...@embedded-brains.de
phone:  +49-89-18 94 741 - 23
mobile: +49-176-15 22 06 - 11

Registergericht: Amtsgericht München
Registernummer: HRA 117265
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: utf32 support

2024-03-19 Thread John Howard
A 32 bit character type is supported by FreeBSD.

Unicode 2012 says utf32 must be a 32 bit signed integer. Unicode only defines 
the Codepoint character attribute.

RTEMS now uses libBSD and newlib. Need kernel to support the Codepoint range of 
values. Applications can then use additional user-defined character attributes.

— John

P.S.: UTF32 exists for Unicode in 2012 after consolidation from ISO 10646-2012. 
The two standards merged.

On Mar 19, 2024, at 6:20 AM, Frank Kühndel  
wrote:

Hello John,

just a side node:

Strictly speaking UTF32 does not exist [1]. The correct name is UCS-4 (i.e 
store each character in four bytes). "Current plans are that there will never 
be characters assigned outside the 21-bit code space from 0x00 to 0x10" 
[2].

References:

[1] Section "Unicode encodings" in 
https://tldp.org/HOWTO/Unicode-HOWTO-1.html#ss1.2

[2] Section "What are UCS and ISO 10646?" in 
https://www.cl.cam.ac.uk/~mgk25/unicode.html

Greetings,
fk

> On 3/18/24 19:02, Gedare Bloom wrote:
> I think it would be wchar_t support in newlib.
>> On Mon, Mar 18, 2024 at 11:56 AM Joel Sherrill  wrote:
>> What does support for UTF-32 entail? Do you have an idea what software 
>> functions you are looking for?
>> 
>> I see the International Components for Unicode (ICU) has a converter 
>> (https://icu.unicode.org/download) which looks it might be part of a 
>> solution.
>> 
>> Multibyte character methods defined by POSIX would be in newlib.
>> 
>> I'm not well versed in this area so have questions but I think it basically 
>> comes down to what software libraries an application needs and porting those 
>> to RTEMS -- assuming the license is ok.
>> 
>> --joel
>> 
>>> On Mon, Mar 18, 2024 at 12:15 PM John Howard  wrote:
>>> I want to add utf32 support.
>>> 
>>> Where do I start?
>>> 
>>> — John
>>> ___
>>> devel mailing list
>>> devel@rtems.org
>>> http://lists.rtems.org/mailman/listinfo/devel
>> ___
>> devel mailing list
>> devel@rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel

-- 
embedded brains GmbH & Co. KG
Herr Frank KÜHNDEL
Dornierstr. 4
82178 Puchheim
Germany
email: frank.kuehn...@embedded-brains.de
phone:  +49-89-18 94 741 - 23
mobile: +49-176-15 22 06 - 11

Registergericht: Amtsgericht München
Registernummer: HRA 117265
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: utf32 support

2024-03-19 Thread Frank Kühndel

Hello John,

just a side node:

Strictly speaking UTF32 does not exist [1]. The correct name is UCS-4 
(i.e store each character in four bytes). "Current plans are that there 
will never be characters assigned outside the 21-bit code space from 
0x00 to 0x10" [2].


References:

[1] Section "Unicode encodings" in 
https://tldp.org/HOWTO/Unicode-HOWTO-1.html#ss1.2


[2] Section "What are UCS and ISO 10646?" in 
https://www.cl.cam.ac.uk/~mgk25/unicode.html


Greetings,
fk

On 3/18/24 19:02, Gedare Bloom wrote:

I think it would be wchar_t support in newlib.

On Mon, Mar 18, 2024 at 11:56 AM Joel Sherrill  wrote:

What does support for UTF-32 entail? Do you have an idea what software 
functions you are looking for?

I see the International Components for Unicode (ICU) has a converter 
(https://icu.unicode.org/download) which looks it might be part of a solution.

Multibyte character methods defined by POSIX would be in newlib.

I'm not well versed in this area so have questions but I think it basically 
comes down to what software libraries an application needs and porting those to 
RTEMS -- assuming the license is ok.

--joel

On Mon, Mar 18, 2024 at 12:15 PM John Howard  wrote:

I want to add utf32 support.

Where do I start?

— John
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel



--
embedded brains GmbH & Co. KG
Herr Frank KÜHNDEL
Dornierstr. 4
82178 Puchheim
Germany
email: frank.kuehn...@embedded-brains.de
phone:  +49-89-18 94 741 - 23
mobile: +49-176-15 22 06 - 11

Registergericht: Amtsgericht München
Registernummer: HRA 117265
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: utf32 support

2024-03-18 Thread Gedare Bloom
I think it would be wchar_t support in newlib.

On Mon, Mar 18, 2024 at 11:56 AM Joel Sherrill  wrote:
>
> What does support for UTF-32 entail? Do you have an idea what software 
> functions you are looking for?
>
> I see the International Components for Unicode (ICU) has a converter 
> (https://icu.unicode.org/download) which looks it might be part of a solution.
>
> Multibyte character methods defined by POSIX would be in newlib.
>
> I'm not well versed in this area so have questions but I think it basically 
> comes down to what software libraries an application needs and porting those 
> to RTEMS -- assuming the license is ok.
>
> --joel
>
> On Mon, Mar 18, 2024 at 12:15 PM John Howard  wrote:
>>
>> I want to add utf32 support.
>>
>> Where do I start?
>>
>> — John
>> ___
>> devel mailing list
>> devel@rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: utf32 support

2024-03-18 Thread Joel Sherrill
What does support for UTF-32 entail? Do you have an idea what software
functions you are looking for?

I see the International Components for Unicode (ICU) has a converter (
https://icu.unicode.org/download) which looks it might be part of a
solution.

Multibyte character methods defined by POSIX would be in newlib.

I'm not well versed in this area so have questions but I think it basically
comes down to what software libraries an application needs and porting
those to RTEMS -- assuming the license is ok.

--joel

On Mon, Mar 18, 2024 at 12:15 PM John Howard  wrote:

> I want to add utf32 support.
>
> Where do I start?
>
> — John
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

utf32 support

2024-03-18 Thread John Howard
I want to add utf32 support.

Where do I start?

— John
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel