Posts

Showing posts with the label PostgreSQL

0xef 0xbb 0xbf characters (Loading the FAA’s Aircraft Registration Database into PostgreSQL)

Image
Trying to import the CSV files supplied by the FAA as the Releasable Aircraft Database Download into PostgreSQL using the COPY command. PostgreSQL was barfing with the error message: character with byte sequence 0xef 0xbb 0xbf in encoding "UTF8" has no equivalent in encoding "LATIN9" Turns out those three bytes are the Byte Order Mark , which somehow I’ve never encountered in a “plain text” file before. Removing those bytes was pretty straightforward in 0xED : Screenshot of 0xED editor The same thing can be accomplished by using the terminal, if 0xED is not available (it’s apparently been discontinued by the developer, so it’s only a matter of time before Apple’s relentless march forward leaves it behind): % tail -c +4 DEREG.txt > DEREG_no_BOM.txt Will do the same thing (strip the first three bytes from, e.g., DEREG.txt, creating the new file DEREG_no_BOM.txt). This process took about 12 seconds on a MacBook Pro M1 Pro 14" base model, FWIW. The other thing ...