lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Humphrey <>
Subject Fwd: Standard or Modified UTF-8?
Date Sat, 27 Aug 2005 14:04:28 GMT

It was suggested that I move this to the developers list from the  
users list...

-- Marvin Humphrey

Begin forwarded message:

From: Marvin Humphrey <>
Date: August 26, 2005 4:51:27 PM PDT
Subject: Standard or Modified UTF-8?


As part of my attempt to speed up Plucene and establish index  
compatibility between Plucene and Java Lucene, I'm porting  
InputStream and OutputStream to XS (the C API for accessing Perl's  
guts), and I believe I have found a documentation bug in the file- 
format spec at...

"Lucene writes unicode character sequences using the standard UTF-8  

Snooping the code in OutputStream, it looks like you are writing  
modified UTF-8 -- NOT standard -- because a null byte is written  
using the two-byte form.

       else if (((code >= 0x80) && (code <= 0x7FF)) || code == 0) {
     writeByte((byte)(0xC0 | (code >> 6)));
     writeByte((byte)(0x80 | (code & 0x3F)));

Can someone please confirm that the intention is to write modified  

Marvin Humphrey
Rectangular Research

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message