TIP: Click on subject to list as thread! ANSI
echo: golded
to: Nicholas Boel
from: Michiel van der Vlist
date: 2024-03-03 22:31:00
subject: Need volonteers to test a

Hello Nicholas,

On Sunday March 03 2024 10:33, you wrote to me:

 NB> So, at this point it's basically working and displaying properly, but
 NB> then comes in the 'characters' vs 'bytes' thing that Golded isn't
 NB> supporting, so it is wrapping what it thinks is double, triple, or
 NB> even quadruple the amount of 'characters' that are there.

When it comes to mapping the number of characters to the number of bytes, when you look at the  UTF-8 encoding table, about two screens down here:

https://en.wikipedia.org/wiki/UTF-8

You can see that the length of the byte sequence can be determined just by looking at the first byte. Look from bit 7 to the right. The number of '1' bits equals the number of bytes in the character. All the follow up bytes start with '10'. So to get the number of characters ignore the bytes starting with '10' when counting the bytes.

Breaking a line should only occur /before/ a byte starting with '0' or '11'.

Knowing all that it should be doable to let Golded display properly.

Perhaps the best strategy is to have Golded alway use UTF-8 internally. Almost everyone else does these days...

 NB> Thank you for the explanation. This definitely helps me to understand
 NB> what is happening.

You'r welcome.


Cheers, Michiel

--- GoldED+/W32-MSVC 1.1.5-b20170303
                                                                  
* Origin: Nieuw Schn¨¨rd (2:280/5555)

SOURCE: echomail via QWK@pharcyde.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.