﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
4086	Bug with IniReadSectionNames if file is coded with UTF-8-BOM	anonymous		"I have an ini-file that is formatted with UTF-8-BOM. If the file does not start with a linebreak, IniReadSectionNames does not retrieve the first section.
{{{#!autoit
Local $sPathA, $sPathB, $sPathC, $sPathD, $hFile

; File A - UTF-8-BOM - No Leading LineBreak
$sPathA = @DesktopDir & ""\File_UTF-8-BOM_v1.ini""
$hFile = FileOpen($sPathA, 2 + 8 + 128)
FileWrite($hFile, ""[SectionA]"" & @CRLF & ""Key=Value"")
FileClose($hFile)

; File B - UTF-8-BOM - Leading LineBreak
$sPathB = @DesktopDir & ""\File_UTF-8-BOM_v2.ini""
$hFile = FileOpen($sPathB, 2 + 8 + 128)
FileWrite($hFile, @CRLF & ""[SectionB]"" & @CRLF & ""Key=Value"")
FileClose($hFile)

; File C - UTF-8 - No Leading LineBreak
$sPathC = @DesktopDir & ""\File_UTF-8_v1.ini""
$hFile = FileOpen($sPathC, 2 + 8 + 256)
FileWrite($hFile, ""[SectionA]"" & @CRLF & ""Key=Value"")
FileClose($hFile)

; File D - UTF-8 - Leading LineBreak
$sPathD = @DesktopDir & ""\File_UTF-8_v2.ini""
$hFile = FileOpen($sPathD, 2 + 8 + 256)
FileWrite($hFile, @CRLF & ""[SectionB]"" & @CRLF & ""Key=Value"")
FileClose($hFile)

Local $aSectionA = IniReadSectionNames($sPathA)
Local $aSectionB = IniReadSectionNames($sPathB)
Local $aSectionC = IniReadSectionNames($sPathC)
Local $aSectionD = IniReadSectionNames($sPathD)
ConsoleWrite(""$aSectionA"" & @TAB & UBound($aSectionA) & @CRLF)
ConsoleWrite(""$aSectionB"" & @TAB & UBound($aSectionB) & @CRLF)
ConsoleWrite(""$aSectionC"" & @TAB & UBound($aSectionC) & @CRLF)
ConsoleWrite(""$aSectionD"" & @TAB & UBound($aSectionD) & @CRLF)
Exit
}}}
"	Bug	new		AutoIt	3.3.18.0	None			
