Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1284 (closed defect: wontfix)

Opened 4 years ago

Last modified 4 years ago

MapStream issue.

Reported by: DiscipleRayne Assigned to: kris
Priority: major Milestone: 1.0
Component: Core Functionality Version: 0.99.7 Dominik
Keywords: Cc:

Description

When MapStream reads from a properties file it does not strip/ignore unt 8 BOM characters, it reads any key=value's other then the first one. The first one always throws an array out of bounds exception.

I'm aparently the only one who has experienced this error and Kris said it shouldn't be throwing this exception in the first place. I have solved this problem myself, but lars requested I make a ticket about it.

-Rayne

Change History

09/14/08 09:30:46 changed by schveiguy

Can you post the example code and file? Use the 'attach file' button.

I have a suspicion that it's trying to lump some weird characters in with the first property value, and then when you try looking up by key, your key doesn't have those weird values.

09/14/08 13:06:31 changed by kris

  • milestone changed from 0.99.8 to 1.0.

I suspect the right way to deal with this is to employ UnicodeBom in some manner ... I mean, simply throwing away the BOM is not exactly a good idea, when its presence is to indicate an encoding (might be UTF16BE or UTF32LE instead).

Alternatively: if you're always using utf8 then don't prefix your documents with a BOM :)

09/15/08 10:42:17 changed by schveiguy

Seeing as how the MapStream is already told the encoding through the template parameter, I think it's beyond the responsibility of MapStream to determine the encoding type. If you want to support encoding, then the right answer would be to read the BOM before creating the MapStream and use the appropriate filter or pass the correct type to the MapStream template in order to read the properties file properly.

10/05/08 02:19:08 changed by kris

  • owner changed from sean to kris.

10/05/08 02:19:49 changed by kris

  • status changed from new to closed.
  • resolution set to wontfix.

Yeah, this has to be handled at a higher level (such as UnicodeFile? or similar)