WordPress can't echo brackets

I am trying to make a simple plugin that will output the URL and title of a post. It should look like this:

http://mysite.com/test-2/{Test 2}

However when I use the code that I posted below, it prints as follows:

http://mysite.com/test-2/Test 2


I can’t figure out why. I’ve tried to escape them, separating each bracket into a string and combining them, but nothing seems to work.

Heres the code

function P2S_menu(){
    echo '<h1>This is a Test</h1>';

    $query = new WP_Query($query_string . '&orderby=title&order=asc&posts_per_page=-1');
        $url = the_permalink();
        $keyword = the_title();
        Print('<p>' . $url . '{' . $keyword . '}' . '</p><br>');
    echo 'Done';


Solutions Collecting From Web of "WordPress can't echo brackets"