# Unicode Conversions in PHP and Remote Git Repos

- Link: https://cagrimmett.com/2016/02/21/unicode-conversions-remote-git/
- Published: 2016-02-21T05:00:00-05:00
- Author: Chuck Grimmett

### Today I learned:

#### Converting Unicode quotation marks in PHP

Unicode quotation marks (sometimes called smart quotes) are those curved/slanted
single and double quotation marks: `“ ” ‘ ’`. The ASCII ones look like this: `" '`.
They are usually interchangeable in word processing, but the stylized ones sometimes
cause issues on the web (in a parser, for example).

To convert one to the other in PHP, use `iconv()`:

    ```php
     $output = iconv('UTF-8', 'ASCII//TRANSLIT', $input);
    ```

If you use OS X and want to turn off smart quotes, go to System Preferences > Keyboard
> Text and uncheck “Use smart quotes and dashes.”

---

#### Remote git repositories

Using git locally is one thing, but it is far more powerful (and exciting!) to push
that code to a remote repository like [Github](http://github.com/cagrimmett) for
display and collaboration.

Assuming you have a local repository that wasn’t cloned from a remote one, you’ll
need to hook it up to a remote repository:

    ```bash
    $ git remote add origin 
    ```

If there is code already on the remote repository, you’ll need to merge it in to
your local:

    ```bash
    $ git pull $ git merge origin/master
    ```

Then push your committed files to the remote repository:

    ```bash
    $ git push origin master
    ```

For a great beginner’s guide to git, check out [Roger Dudler’s git – the simple guide](http://rogerdudler.github.io/git-guide/).

---

#### Toggl Slash Command for Slack

Today I released my first personal project on Github: [Toggl Slash Command for Slack](https://github.com/cagrimmett/slack-toggl-command).

It is a custom [slash command](https://api.slack.com/slash-commands) that enables
users to put time entries into [Toggl](http://toggl.com) from [Slack](http://slack.com).

If you use it, I’d love to know! It is in its rough early stages, but I have some
future additions planned for it, so stay tuned.
