Ask Your Question

strange 1st character when saving as text (solved) [closed]

asked 2017-04-08 17:20:52 +0100

Pansmanser gravatar image

updated 2017-04-08 18:04:30 +0100

Very strange behaviour! When I open any .odt file and save as .txt, the first character of the first line is asc(65279) (zero-width no-break space). Any reason for this? Can I prevent it? A bug?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-09-29 15:14:23.371280

2 Answers

Sort by » oldest newest most voted

answered 2017-04-08 17:52:22 +0100

updated 2017-04-08 17:57:19 +0100

You cannot use UTF8/UTF16 and avoid BOM. Only if your text is ASCII/US, you may use that encoding and get the same bytes as UTF8 without BOM.

edit flag offensive delete link more

answered 2017-04-08 18:03:56 +0100

Pansmanser gravatar image

Thank you Mike. I was just coming back to say I had discovered that, but you beat me to it. Since I was trying to do this in a basic macro, the code is:

oArgs(0).name = "Overwrite" : oArgs(0).value = true
oArgs(1).Name = "FilterName" : oArgs(1).Value = "Text (encoded)"
oArgs(2).Name = "FilterOptions" : oArgs(2).Value = "ASCII_US,LF,,,"
StarDesktop.getCurrentComponent().StoreAsUrl(ConvertToUrl(sFileName), oArgs)
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-04-08 17:20:52 +0100

Seen: 61 times

Last updated: Apr 08 '17