-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
ansi-or-ascii-and-unicode-or-utf-8-and-newlines.scroll
43 lines (25 loc) · 1.7 KB
/
ansi-or-ascii-and-unicode-or-utf-8-and-newlines.scroll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
date 2010-2-25
tags index
permalink ansi-or-ascii-and-unicode-or-utf-8-and-newlines.html
title ANSI or ASCII and Unicode or UTF-8 and Newlines
pageHeader.scroll
The key things you need to know:
ANSI (aka ASCII) and UTF-8 (aka "UnicodeTransformation Format" or just "Unicode") are ways to encode text files into binary data.
I'm simplifying things but actually what I'm leaving out is not important. There are basically 2 character sets: ASCII or ANSI and UTF8 or Unicode. It's probably easiest to just call them ASCII and Unicode.
Unicode is the new guy, and is slowly replacing ASCII.
The main problem you'll run into with ASCII is line breaks. This isn't really an ASCII issue, it's a Windows issue but it often seems like it's an ASCII issue.
Windows does \r\n, whereas Unicode just does \n.
Here's an experiment you can do using Notepad++ and Notepad.
Open Notepad++ and start a new document.
Type in:
code
hello<br>world
Click "Edit", "EOL Completion" and click "Windows Format" (if it's gray, that means it's already on Windows format). Now cut and paste the text into Notepad. You'll see that it comes out on 2 lines. All good right?
Now go back to Notepad++ and click "Edit", "EOL Completion" and click "UNIX Format". Now cut and paste the text into Notepad. It's on 1 line, right?
Tada!
Now when you're having line problems just use this nifty feature in Notepad++.
# Notes
- 1. Okay so this article turned out to be about line breaks and not about character encoding. I blame ADD.
- 2. <A href="http://vlaurie.com/computers2/Articles/characters.htm">Cast of Characters- ASCII, ANSI, UTF-8 and all that</a>
- 3. <a href="http://www.rapidintellect.com/AEQweb/mansub1.htm">ANSI versus Unicode</a>
footer.scroll