Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2002
    Location
    São Paulo, BRAZIL
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    URL´s special codes

    Hello dudes, someone here knows where can i find all URL´s special caracteres? Like %20 ( that means space ), i want to know which code is \n.

    Regards,
    LottaLava

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    \n represents the notion of a newline, that is LF, CRLF, CR or NEL depending on the operative system. LF if 0a, CR is 0d.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #3
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    alert(escape('a!~@!#$%^$%$&^%&)(*_()-_|'))
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #4
    New Coder
    Join Date
    Oct 2002
    Location
    São Paulo, BRAZIL
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I found a site that explain how to convert \n, \t and other caracter to URL encoder, we can use String.charCodeAt( ) to convert those caracters, mainly its a conversion in hex of ascii caracter´s value. For example: Space hex => 20. But just now i know that.

    Thank you,
    LottaLava

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    As Alien51 pointed out. You can just escape the special character to get the encoded value;

    var chars = '! ~@!#%^$&)(*_-_|+<>=\t\r\n';
    var arr = chars.split('');
    var str = '';
    for (var i=0;i<arr.length;i++) str+=arr[i] + ' --> ' + escape(arr[i]) + '\n';
    alert(str);
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •