home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,139 of 4,675   
   rugxulo@nospicedham.gmail.com to Robert Prins   
   Re: More UTF-8 woes - UTF-8 to "\uN" RTF   
   30 Nov 17 00:40:38   
   
   Hi,   
      
   On Wednesday, November 29, 2017 at 1:00:54 PM UTC-6, Robert Prins wrote:   
   >   
   > I realized that while pulling in the actual in-line code this afternoon, and   
   > while doing so I also found out that some of my UTF-8 to "\Un" conversions   
   break   
   > the 255-byte limit on the ancient Pascal strings, so I will have to go back   
   to   
   > the drawing board, not just to figure out how to detect bytes with the two   
   top   
   > bits set (I guess a variation on Alan Mycrofts "#has_nullbyte") and where   
   they   
   > are set, and how to check YMM registers for zero, but also how to handle   
   strings   
   >  > 255 bytes, although that should be pretty straight-forward, given that I'm   
   > already bypassing Write(Ln) and moving most of my output data directly into   
   > extended buffer added to the output file.   
      
   I don't have Virtual Pascal installed on this laptop, but a quick online   
   search of VP21LANG.PDF mentions this:   
      
   "   
   Virtual Pascal supports two types of strings: short strings and long   
   strings.   
   ...   
   The long string type is a structured type that contains a sequence of   
   characters, whose length is only limited by available memory. It is   
   allocated dynamically during program execution. The long string type   
   is not available in Borland  Pascal or in 16-bit Borland Delphi v1.x   
   but is supported by 32-bit versions of Borland Delphi and by Virtual   
   Pascal. The state of the {$H-} compiler directive determines whether   
   the reserved word string denotes a short string or a long string. In   
   Virtual Pascal, the default state of the directive is {$H-}.   
      
   Irrespective of the state of these compiler directives, the predefined   
   identifiers ShortString and AnsiString (defined in the System unit)   
   can be used to explicitly select the desired string type.   
   ...   
   Long strings do not have their length stored as a single byte at   
   offset 0 (as do  short strings); to get the length of a long string,   
   the Length function should be used. To set the length of a long string   
   string explicitly, the SetLength standard procedure should be used.   
   ...   
   [and it further mentions more low-level details, if you're curious]   
   "   
      
   N.B. Free Pascal just released 3.0.4, and yes, they too support the   
   longer ANSI strings, among others.   
      
   http://wiki.freepascal.org/Character_and_string_types   
   https://www.freepascal.org/docs-html/rtl/system/unicodesupport.html   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca