Special Characters & Punctuation

 

Wimpy leverages a number of computer languages including Javascript, HTML, XML, JSON, PHP. Certain characters and/or puntuation symbols hold special meaning within each language -- these characters are "illegal" and sometimes refered to as "reserved characters".

Reserved Characters that have special meaning in computer code languages:

&
ampersand # number sign = equals
' single quote $ dollar sign @ at
" double quote ( left paranthesis [ left bracket
< less than } right paranthesis ] right bracket
> greater than * star { left curly bracket
, comma + plus } right curly bracket
! exclaimation point ; semi-colon    

Reserved Characters that have special meaning in URLs

? Used to impart a query-string onto the URL.
& Used to delimit query-string parameters
= Used to define key-value pairs in a query string
# Used to target an anchor within the HTML page
/ Used as a directory seperator
: Used to designate the protocol
@ Used to identify a user

Encode

For each area of concern (as explained below), you may need to encode the text used in a playlist, in HTML or in URLs.

Use the Encoder Tool to properly format text.

Launch Encoder Tool >

 

Areas of Concern

1. URLs
If a URL contains an illegal character it must be "encoded" (converted into a special code) otherwise the browser will be unable to make a connection to the file, and the playlist or media file won't load.

Illegal characters need to be "URI encoded" (that's not a typo, URI stands for Uniform Resource Identifier). URI encoding causes non-alpha numeric characters to take on the "decimal" form. For example the "&" character is represented as "%26", and the "space" character as "%20".

2. Programming Languages
In HTML & Javascript, there are a few characters that are tricky to contend with:
'   Single Quote / Apostrophe
"   Double Quote
You can esacpe quotes by adding a \backslash in front of the quote.

In XML Playlists there are 4 characters that must be converted to an "entity":

  Symbol Entity Alternate Entity
> Greater Than %3E &gt;
< Less Than %3C
&lt;
& Ampersand %26 &amp;
% Percent %25 &#37;

I recommend using the %XX entities because you can avoid some issues related to &. However, the alternate entities are generally accepted as OK.

3. Display Text
If a character to be displayed in the player is illegal for use within the HTML language, it must be "encoded" (converted into a special code) in order display properly. If the character is not encoded, the entire page may "break" or the character may look like garbled-code.

Illegal characters need to be converted into their respective "HTML entity". For example the "&" character's respecive HTML entity is: "&amp;", and the "space" character as "&nbsp;".

Folder & File Names

When setting up Wimpy, media files and any external files such as skin files and playlists, choose the folder and file names wisely. File and folder Names should only contain alpha-numeric characters, plus dot, dash and underscore.

Acceptable characters to use for folder and file names are:

A through Z
0 through 9
.  -  _   (dot, dash and underscore)

For example, on your PC (or Mac), if you attempt to name a folder with a colon in it such as "try : this" -- you'll see that the system won't allow it.

Windows 8 Said:

Macintosh Said:

Web server's have similar issues. This kind of problem exacerbates itself when we try and target a file with a URL Avoid using the following punctuation symbols, if possible, especially:

"   double quotes
'    single quotes
:    colon
/    forward slash
\    back slash
&  ampersand
%  percent
< > brackets
;    semicolon
?    question mark

Understandably, sometimes we use punctuation. If we do, we'll need to "encode" specific characters when we write the URL. We'll cover in the "Encoding" section below.

Spaces in Folder & File Names

While spaces should not be used in folders or file names because the space character is "illegal" in URLs. But many people use them and it has become **almost** acceptable to use spaces, simply because humans like them -- and the web is rather forgiving. Many browsers and/or servers have learned to deal with spaces effectively by translating (encoding and decoding) them for us "on the fly", so it may seem OK to use spaces, but you should avoid using them because it will reduce headaches in the long-run.

Wimpy incorporates a special feature that automatically converts underscores to spaces. When Wimpy parses a file name for use as the title (for example if data-media="my_song.mp3"), underscore chracters will be replaced with a space character for display in the player.

Example:

"my_song_title.mp3"

.... will display in the player as:

"my song title"

 

Non-English Characters

Computers and web servers allow folders and files to use non-english characters. . For example, the Chinese language uses "picture-based" glyphs (廣州話 characters). Likewise, languages such as Spanish include characters that use umlaut's (ö, ü Ä). These kinds of characters are perfectly valid for use as folder and file names because they don't hold special meaning for computer languages/protocols.

These kinds of characters are refered to as "double-byte" characters because each character requires 2x the storage space. And they can be problematic because web pages and web servers can be configured to treat characters using specific "human language" character "sets".

Wimpy is set up to use UTF-8 Character Encoding exclusively because this character set is the most flexable in terms of the shear number of characters available within the UTF-8 specification.

Since Wimpy operates within the context of the web page it is used within, the character set defined in the <meta> of the HTML can cause Wimpy to display text incorrectly.

We highly recommend that your HTML pages use the following meta tag:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Your page should only include one reference to the "charset" value. If your page includes another reference, such as:

Windows-1252
ISO-8859-1
HZ
us-ascii

... we recommend removing this reference, or replacing it with the UTF-8 charset.

Editing Source Code

When modifying code for use on your pages, use a "Source Code Editor" to eliminate characters from being re-formatted or altered, which can break the code.

- Do not use programs such as MS Word. Instead, use a simple text editor such as NotePad or another Source Code Editor -- use something that was designed for writing computer languages. 

- Word Processor's (such as MS Word) are designed to deal with human languages and often insert un-nessesacry quotes, line breaks and other punctuation that will "break" computer code.

For example, some Word Processors automatically convert "straight quotes" into "fancy" or "smart" quotes. Computer code always uses straight quotes, if a Word Processor changes them to fancy quotes, the code will break. Often times fancy quotes will be mis-represented within URLs as well. So it's best to avoid using fancy quotes altogether.

Bad, slanted.
Bad, slanted.
Bad, slanted backwards (back-tick).
Bad, fancy
Bad, fancy
Good single quote. Nice and straight!
Good double quote. Nice and straight!

 

Encoding

If you're having problems with files, or something is displaying wierd in the player, we recommend using Customizer or Button Writer to set up the HTML, Javascript, or playlist. These tools were designed to encode the URLs and display text properly.