PlainText encoding problems

If, like me, you are a user of the iPhone app PlainText, you may have come across the same issue that I recently did:

A text file created in PlainText may not be able to open in PlainText after being edited on the computer. Instead you get a blank page with the words “Document couldn’t be opened” at the top.

It doesn’t happen with all files, however.

Before I go on, I’d just like to point out that PlainText is an excellent app, easy to use, and does exactly what it is supposed to do, save for this single minor issue.

I ran into this problem after editing an existing file (created in PlainText 2 on my iPhone) on my Windows 7 PC (using Notepad++). Long story short, my solution was to remove a single accented letter (an é in the word début, the only non-ASCII character used in the text) which I had typed in on the PC, and after a sync the file opened in PlainText without problems.

  • Text files created in PlainText identify as ANSI on the computer, but character encoding within the “ANSI” file corresponds to UTF-8. The file may need to be converted to UTF-8 to display correctly.
  • Text files created as UTF-8 on the computer open fine in PlainText, even with non-ASCII characters.
  • Text files created in PlainText WITH accented or other non-ASCII characters, then edited on the computer, open fine in PlainText.
  • Text files created in PlainText WITHOUT accented or other non-ASCII characters will NOT open in PlainText if non-ASCII characters are added on the computer.

Workaround

When you create a file in PlainText which you plan to edit on your computer, add any non-ASCII character in PlainText first. Throughout my testing, this seems to do the trick.

For reference, the complete list of legal (visible) ASCII characters is as follows:

 !”#@%&'()*+,-./01234567890:;<=>
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
`abcdefghijklmnopqrstuvwxyz{|}~ 

Anything not covered by this list is a non-ASCII character and likely to cause trouble in the above scenario.

How to type a non-ASCII character on the iPhone: Press and hold a letter key (for example “O”). After a moment you will be presented with a number of alternate characters (in the case of “O” you get “Õ Ō Ø Œ Ó Ò Ö Ô”), just pick one. Most if not all of those characters will be non-ASCII.

References:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: