The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,478 other followers

Archive for the ‘Encoding’ Category

[NL] encoding blijft moeilijk, waarom toch? (dit keer in een brief van @xs4all)

Posted by jpluimers on 2015/02/24

Hoe moeilijk kan het toch zijn om je encoding goed te doen.

Deze keer uit een brief van xs4all:

encoding foutje...

encoding foutje…

Als je een trema in een brief zet, dan controleer je toch even dat die ook goed op de brief wordt afgedrukt?

Een “inverted question mark” (deze keer samen met een oe ligature) duidt vrijwel altijd op een encoding probleem.

Ook bij de bevestigings email ging het mis:

bij de beï¿œindiging van uw oude abonnement.

En jawel hoor: de encoding daar was geen UTF-8:

Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8bit

Even een korte inspectie om te zien of het een simpele UTF-8 naar ISO-8859-15 conversie fout betreft: nee.

karakter iso-8859-15
hex
utf-8
hex
Unicode
hex
Unicode
naam
Unicode block
ï 0xCF 0xC3 0xAF U+00EF LATIN SMALL LETTER I WITH DIAERESIS Latin-1 Supplement
¿ 0xBF 0xC2 0xBF U+00BF INVERTED QUESTION MARK Latin-1 Supplement
œ 0xBD 0xC5 0x93 U+0153 LATIN SMALL LIGATURE OE Latin Extended-A

Ik hoop dat een xs4all techneut hier voldoende aan heeft (:

–jeroen

Posted in Development, Encoding, ISO-8859, Software Development, Unicode, UTF-8, UTF8 | Leave a Comment »

Windows Alt Key Codes

Posted by jpluimers on 2015/02/16

Brillant!: Windows Alt Key Codes.

The page has both lists of four-digit ALT+#### codes, a how-to, and reference links:

  1. Letters with Accents – (e.g. ó, ò, ñ)
  2. Other Foreign Characters – (e.g. ç, ¿, ß)
  3. Currency Symbols – (e.g. ¢, £, ¥)
  4. Math Symbols – (e.g. ±, °, ÷)
  5. Other Punctuation – (e.g. &, ©, §)
  6. Using the Codes
  7. Other Accents and Symbols: Character Map Other Page
  8. Non-Numeric Accent Codes: Activate International Keyboard Other Page
  9. Links to Other References

–jeroen

Posted in Development, Encoding, Power User, Software Development, Unicode, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Leave a Comment »

ASCII is not just an RFC. It is an Internet Standard, but only recently.

Posted by jpluimers on 2015/01/29

When people tell you that ASCII is not an Internet Standard but an RFC. They are wrong. They used to be right though. Until 2015-01-12, when IETF declared the RFC 20 to be an Internet Standard: status-change-rfc20-ascii-format-to-standard-00.

So after more than 45 years (like many good things, the ASCII RFC is from 1969), it is not just an American Standard but an Internet Standard (:

Thanks Lauren Weinstein for sharing and Kristian Köhntopp for pointing to the reclassification.

–jeroen

via: ASCII – Wikipedia, the free encyclopedia.

Posted in ASCII, Development, Encoding, History, Software Development | Leave a Comment »

Great Unicode presentation by

Posted by jpluimers on 2015/01/21

Stefan Heymann did a great presentation Character Sets and Unicode in Firebird at fbcon11. About 90% of it is not about Firebird, but about Unicode: a highly recommended presentation.

There is also a PDF version of the same presentation for easier reading/searching.

If you like Firebird, there is a whole bunch of Firebird related presentations from various authors shared by MindTheBird.

–jeroen

Posted in Ansi, Database Development, Development, Encoding, Firebird, ISO-8859, ISO8859, Software Development, Unicode, UTF-8, UTF8 | Leave a Comment »

Delphi: ZEROBASEDSTRINGS and maintaining cross-version Delphi libraries

Posted by jpluimers on 2015/01/14

One of the features that bites me over and over again is the ZEROBASEDSTRINGS that got introduced in Delphi XE3 and is by default ON in mobile compilers and OFF in Desktop compilers.

Back then, Mark Edington showed a small example of the effects:

and then explained:

The XE3 RTL source code has been refactored to be string index base agnostic. In most cases this is done by utilizing string helper functions which are always zero based.
When it is necessary to traverse a string, the Char[] property is often used to access the individual characters without concern for the current state of the compiler with respect to zero based strings.

In addition, the “Low” and “High” standard functions can now be passed a string variable to provide further flexibility as needed.
When zero based strings are enabled, Low(string) will return 0,  otherwise it will return 1. Likewise, High() returns a bounds adjusted length variation.

The problem is the non-existent forward compatibility of the other compilers (Delphi XE2 and lower).

So if you have library code that needs to work in Delphi versions, you cannot use the High and Low to make the code ZEROBASEDSTRINGS neutral.

Many Delphi developers regularly skip many Delphi versions, so these are still popular:

  • Delphi XE1 and XE2 (the last 2 compilers before Delphi really started to support mobile)
  • Delphi 2007 (the last non-Unicode Delphi compiler)
  • Delphi 7 (the last non-Galileo IDE)

The result is that library code is full of conditionan IF/IFDEF blocks like these:

Fix: this works only in XE3 or higher: “for Index := Low(input) to High(input) do // for ZEROBASEDSTRINGS”

–jeroen

via: Mark Edington’s Delphi Blog : XE3 RTL Changes: A closer look at TStringHelper.

Posted in Ansi, Delphi, Delphi 2007, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Encoding, Software Development, Unicode | 8 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 1,478 other followers

%d bloggers like this: