Convert to DOS.

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
ravilobo
Posts: 18
Joined: Fri Dec 14, 2007 8:45 pm

Convert to DOS.

Post by ravilobo »

When I try to see the content of file (by TYPE DOS command), every character is delimited by a space. After – converting the file to DOS – in textpad, the file looks fine.

Why does this happen?
ACRobin
Posts: 134
Joined: Fri Nov 04, 2005 9:51 pm
Location: Northumberland,UK
Contact:

Post by ACRobin »

What font are you using in TP to view the file? Make sure you are using a fixed width font like courier.

You could turn on the "Visible" icon (next to the globe) and that will show for definate if a space exists between characters.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Your file uses the Unicode character set, UTF-16 encoded. Each character occupies 2 bytes (16 bits). Presumably, your file only contains characters that are in the 8-bit ISO 8859-1 character set (or its subset, the 7-bit ASCII character set). The Unicode and ISO 8859-1 values of these characters are the same, and so fit into a single byte; the top byte is zero, that is, a null character. TYPE doesn't recognise Unicode. and outputs the nulls as spaces.

(Note: this is a bit of a simplification.)
ravilobo
Posts: 18
Joined: Fri Dec 14, 2007 8:45 pm

Post by ravilobo »

Thank you Ben. That makes sense.
Post Reply