From: ALJ on
Hi Salad,

Cheers for that.

I have continued doing a lot of digging around, I found out that part
of the problem is that ADODB.stream exports as UTF-8 with BOM. I found
that if I converted it to UTF-8 without BOM then the receiving
application didn't choke.

(This was originally posted by Simon Pedersen at
http://www.imagemagick.org/discourse-server/viewtopic.php?f=8&t=12705)

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' Removes the Byte Order Mark - BOM from a text file with UTF-8
encoding
' The BOM defines that the file was stored with an UTF-8 encoding.

Public Function RemoveBOM(filePath)

' Create a reader and a writer
Dim writer, reader, fileSize
Set writer = CreateObject("Adodb.Stream")
Set reader = CreateObject("Adodb.Stream")

' Load from the text file we just wrote
reader.Open
reader.LoadFromFile filePath

' Copy all data from reader to writer, except the BOM
writer.Mode = 3
writer.Type = 1
writer.Open
reader.Position = 5
reader.CopyTo writer, -1

' Overwrite file
writer.SaveToFile filePath, 2

' Return file name
RemoveBOM = filePath

' Kill objects
Set writer = Nothing
Set reader = Nothing
End Function
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
From: ALJ on
Hi Salad,

Cheers for that.

I have continued doing a lot of digging around, I found out that part
of the problem is that ADODB.stream exports as UTF-8 with BOM. I found
that if I converted it to UTF-8 without BOM then the receiving
application didn't choke.

(This was originally posted by Simon Pedersen at
http://www.imagemagick.org/discourse-server/viewtopic.php?f=8&t=12705)

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' Removes the Byte Order Mark - BOM from a text file with UTF-8
encoding
' The BOM defines that the file was stored with an UTF-8 encoding.

Public Function RemoveBOM(filePath)

' Create a reader and a writer
Dim writer, reader, fileSize
Set writer = CreateObject("Adodb.Stream")
Set reader = CreateObject("Adodb.Stream")

' Load from the text file we just wrote
reader.Open
reader.LoadFromFile filePath

' Copy all data from reader to writer, except the BOM
writer.Mode = 3
writer.Type = 1
writer.Open
reader.Position = 5
reader.CopyTo writer, -1

' Overwrite file
writer.SaveToFile filePath, 2

' Return file name
RemoveBOM = filePath

' Kill objects
Set writer = Nothing
Set reader = Nothing
End Function
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
From: ALJ on
Hi Salad,

Cheers for that. I did some digging around and found that if I removed
the BOM from the UTF8 file generated by Access, then the receiving
application imported everything fine. So there's two approaches of
sorting the same problem out, which I hope will help other people in
the same situation. It's been a real pain the behind to get this
sorted.

(This was originally posted by Simon Pedersen at
http://www.imagemagick.org/discourse-server/viewtopic.php?f=8&t=12705)

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' Removes the Byte Order Mark - BOM from a text file with UTF-8
encoding
' The BOM defines that the file was stored with an UTF-8 encoding.

Public Function RemoveBOM(filePath)

' Create a reader and a writer
Dim writer, reader, fileSize
Set writer = CreateObject("Adodb.Stream")
Set reader = CreateObject("Adodb.Stream")

' Load from the text file we just wrote
reader.Open
reader.LoadFromFile filePath

' Copy all data from reader to writer, except the BOM
writer.Mode = 3
writer.Type = 1
writer.Open
reader.Position = 5
reader.CopyTo writer, -1

' Overwrite file
writer.SaveToFile filePath, 2

' Return file name
RemoveBOM = filePath

' Kill objects
Set writer = Nothing
Set reader = Nothing
End Function
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

ALJ
From: ALJ on
Hi Salad,

Cheers for that. I did some digging around and found that if I removed
the BOM from the UTF8 file generated by Access, then the receiving
application imported everything fine. So there's two approaches of
sorting the same problem out, which I hope will help other people in
the same situation. It's been a real pain the behind to get this
sorted.

(This was originally posted by Simon Pedersen at
http://www.imagemagick.org/discourse-server/viewtopic.php?f=8&t=12705)

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' Removes the Byte Order Mark - BOM from a text file with UTF-8
encoding
' The BOM defines that the file was stored with an UTF-8 encoding.

Public Function RemoveBOM(filePath)

' Create a reader and a writer
Dim writer, reader, fileSize
Set writer = CreateObject("Adodb.Stream")
Set reader = CreateObject("Adodb.Stream")

' Load from the text file we just wrote
reader.Open
reader.LoadFromFile filePath

' Copy all data from reader to writer, except the BOM
writer.Mode = 3
writer.Type = 1
writer.Open
reader.Position = 5
reader.CopyTo writer, -1

' Overwrite file
writer.SaveToFile filePath, 2

' Return file name
RemoveBOM = filePath

' Kill objects
Set writer = Nothing
Set reader = Nothing
End Function
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

ALJ
From: ALJ on
Hi Salad,

Cheers for that. I did some digging around and found that if I removed
the BOM from the UTF8 file generated by Access, then the receiving
application imported everything fine. So there's two approaches of
sorting the same problem out, which I hope will help other people in
the same situation. It's been a real pain the behind to get this
sorted.

(This was originally posted by Simon Pedersen at
www.imagemagick.org/discourse-server/viewtopic.php?f=8&t=12705)

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' Removes the Byte Order Mark - BOM from a text file with UTF-8
encoding
' The BOM defines that the file was stored with an UTF-8 encoding.

Public Function RemoveBOM(filePath)

' Create a reader and a writer
Dim writer, reader, fileSize
Set writer = CreateObject("Adodb.Stream")
Set reader = CreateObject("Adodb.Stream")

' Load from the text file we just wrote
reader.Open
reader.LoadFromFile filePath

' Copy all data from reader to writer, except the BOM
writer.Mode = 3
writer.Type = 1
writer.Open
reader.Position = 5
reader.CopyTo writer, -1

' Overwrite file
writer.SaveToFile filePath, 2

' Return file name
RemoveBOM = filePath

' Kill objects
Set writer = Nothing
Set reader = Nothing
End Function
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

ALJ