Err...
First of all, keyboards have keys on them, not characters. A character is an idea, so that would be absurd.
Second, you're running the program in a terminal emulator. The terminal emulator uses a font to convert the output of your program into a graphical representation that can ultimately be understood by your visual cortex. A font is, basically, a collection of glyphs (i.e. images) assigned to specific character values. This assignment is arbitrary, but it does follow certain conventions. The pipe character ('|') is typically assigned either a glyph that looks like a vertical line, or a glyph that looks like a vertical line with a break in the middle, as you're seeing. Some fonts have the former, while others have the latter. The terminal emulator you happen to be using may support a font that will make pipes look the way you want, or it may not.