Florian Reuter's Weblog

Florian Reuter's Weblog

Florian Reuter's Weblog

Alle | Breakpoint | General

Main | Flat OpenDocument »
20050311 Freitag März 11, 2005

Real Life Bugs! For everybody interested in *real life bugs* consider OpenOffice bug #i35653#. The story is as follows: The attached RTF bug-doc contains the sub-string BEGINŽEND, but Writer only shows BEGIN and discards the suffix ŽEND. The reason is a *real life bug*: The Czech character Ž has the unicode number 381, which is corretly returned by the GetNextChar() function. In the source there is a line nSlash = (sal_Char)GetNextChar(); which casts the Unicode character 381 to a sal_Char, which is a 8-Bit character. Unfortunately 381 cast to 8-bit is 125, and 125 is the ASCII code for "}". Here comes the real life characteristic of the bug. "}" is a special RTF token which causes the RTF reader to stop. There are so many Unicode characters. Why for gods sake must the Czech Ž cast to 8-bit must be the special "}" RTF token? And the moral is: *Beware of casts!* ( Mrz 11 2005, 10:14:21 AM PST ) Permalink Kommentare [1]

Trackback URL: http://blogs.sun.com/flo/entry/real_life_bugs
Kommentare:

Hey Ho, here are some greetings right from beside your tidy living room :))

Gesendet von Thorsten am März 12, 2005 at 09:14 AM PST #

Senden Sie einen Kommentar:

Name:
E-Mail:
URL:

Ihr Kommentar:

HTML Syntax: Ausgeschaltet

Page Hits heute: 4