bom

BOM in a PHP page auto generated by Wordpress

I admin two different blogs. They are both wordpress 2.8.6 (so they have exactly the same source code, plugins apart) but they are located on two different hosting platform (hostmonster.com and aruba.it). To explain my problem I've dumped with SmartSniff a session with each one of the sites. Here is the dump from hostmonster: GET /blog...

Byte order mark screws up file reading in Java

I'm trying to read CSV files using Java. Some of the files may have a byte order mark in the beginning, but not all. When present, the byte order gets read along with the rest of the first line, thus causing problems with string compares. Is there an easy way to skip the byte order mark when it is present? Thanks! ...

How to avoid inadvertent encoding of UTF-8 files as ASCII/ANSI?

In the process of editing a file encoded as UTF-8 w/o [spurious] BOM the content might become devoid of any Unicode characters outside the ASCII or ANSI ranges. At the next reopening of the file, some text editors (Notepad++) will interpret it as ASCII/ANSI encoded and open it as such. Unaware of the change the user will continue editing...

Unicode BOM for UTF-16LE vs UTF32-LE

It seems like there's an ambiguity between the Byte Order Marks used for UTF16-LE and UTF-32LE. In particular, consider a file that contains the following 8 bytes: FF FE 00 00 00 00 00 00 How can I tell if this file contains: The UTF16-LE BOM (FF FE) followed by 3 null characters; or The UTF32-LE BOM (FF FE 00 00) followed by one ...

NSXMLParser and BOM bytes

Hi, I'm getting my xml file as a result of a php query from some server. When I print the resulting data to the console I'm getting well-structured xml file. When I try to parse it using NSXMLParser it returns NSXMLParserErrorDomain with code 4 - empty document. I saw that xmls that it couldn't parse have BOM (Byte order mark) sequence ...

How to force Visual Studio to honor the BOM at the start of a UTF-8 encoded CSS file?

Apparently, when Visual Studio 2008 (SP1) opens a CSS file, it doesn't recognize the UTF8 BOM marker as a BOM, but instead interprets it as text (first three characters show up as , but shouldn't be visible). While VS normally doesn't save the CSS files with a BOM, I'd expect the IDE to recognize and respect the BOM when it's there. ...

Load XMLDocument from byte array (optionally containing BOM characters)

I've seen several posts here on SO about loading XML documents from some data source where the data has Microsoft's proprietary UTF-8 preamble (for instance, this one). However, I can't find an elegant (and working!) solution which does not involve striping out BOM characters manually. For instance, there is this example: byte[] b = Sy...

What is the difference between Browser Object Model vs Document Object Model

What is the difference between the two? Can someone explain, thx. ...

What's different between utf-8 and utf-8 without BOM?

What`s different between utf-8 and utf-8 without BOM? Which is better? ...

Dealing with UTF-8 numbers in Python

Hi, I have read many similar questions, apologies if this is considered a duplicate. Suppose I am reading a file containing 3 comma separated numbers. The file was saved with with an unknown encoding, so far I am dealing with ANSI and UTF-8. If the file was in UTF-8 and it had 1 row with values 115,113,12 then: with open(file) as f: ...

Write text files without Byte Order Mark (BOM) ?

I am trying to create a text file using VB.Net with UTF8 encoding, without BOM. Can anybody help me, how to do this? I can write file with UTF8 encoding but, how to remove Byte Order Mark from it? Thanks in Advance. edit1: I have tried code like this; Dim utf8 As New UTF8Encoding() Dim utf8EmitBOM As New UTF8Encoding(True) ...

UTF-8 HTML and CSS files with BOM (and how to remove the BOM with Python)

First, some background: I'm developing a web application using Python. All of my (text) files are currently stored in UTF-8 with the BOM. This includes all my HTML templates and CSS files. These resources are stored as binary data (BOM and all) in my DB. When I retrieve the templates from the DB, I decode them using template.decode('utf...

Create Text File Without BOM

Hi guys, I tried this aproach without any success the code I'm using: // File name String filename = String.Format("{0:ddMMyyHHmm}", dtFileCreated); String filePath = Path.Combine(Server.MapPath("App_Data"), filename + ".txt"); // Process myObject pbs = new myObject(); pbs.GenerateFile(); // pbs.GeneratedFile is a S...

java: can I convert strings to byte arrays, without a BOM?

Suppose I have this code: String encoding = "UTF-16"; String text = "[Hello StackOverflow]"; byte[] message= text.getBytes(encoding); If I display the byte array in message, the result is: 0000 FE FF 00 5B 00 48 00 65 00 6C 00 6C 00 6F 00 20 ...[.H.e.l.l.o. 0010 00 53 00 74 00 61 00 63 00 6B 00 4F 00 76 00 65 .S.t.a.c....

UTF-8 BOM signature in PHP files

I was writing some commented PHP classes and I stumbled upon a problem. My name (for the @author tag) ends up with a ș (which is a UTF-8 character, ...and a strange name, I know). Even though I save the file as UTF-8, some friends reported that they see that character totally messed up (È™). This problem goes away by adding the BOM sign...

PHP Streaming CSV always adds UTF-8 BOM

The following code gets a 'report line' as an array and uses fputcsv to tranform it into CSV. Everything is working great except for the fact that regardless of the charset I use, it is putting a UTF-8 bom at the beginning of the file. This is exceptionally annoying because A) I am specifying iso and B) We have lots of users using tools ...

create an UTF-8 string with BOM

Hi guys, I'm using MD5 function and Base64 Encoding to generate a User Secret (used to login to data layer of the used API) I did the code in javascript and it's fine, but in Objective C I'm strugling with the BOM my code is: NSString *str = [[NSString alloc] initWithFormat:@"%@%@%@%d", [auth up...

PHP File unreadable after being downloaded

Hi I have a script that creates a file and stores it on the server. The file is encoded in UTF-8 and is a kind of xml file for the cmap software. If i open the file directly from the server then there is no problem and the file can be read. I am forcing a download of this file when a user goes to a specific url. After such a download...

Python BOM error in Ascii file

I have a wierd annoying problem with Python 2.6 I trying to run this file (and the other), on my Embedded Linux ARM board. http://svn.tuxisalive.com/software_suite_v3/smart-core/smart-server/trunk/TDSService.py I get this error File "tuxhttpserver.py", line 1 SyntaxError: encoding problem: with BOM I know that error is about ...

JavaScript - Does the browser keep track of active timer IDs?

Does the browser keep track of active setInterval and setTimeout IDs? Or is this solely up to the developer to keep track of? If it does keep track of them, is it accessible via the BOM? ...