Skip to Main Content
×
Freshbooks
Official App
Free – Google Play
Get it
FreshBooks is Loved by American Small Business Owners
FreshBooks is Loved by Canadian Small Business Owners
FreshBooks is Loved by Small Business Owners in the UK
Dev Blog

UTF-8 is here!

by Taavi on September 21/2011

Today I’m happy to announce that FreshBooks is fully UTF-8!

What this means for you: You can use unicode snowman and all the other characters in the Unicode Basic Multilingual Plane to your heart’s content, knowing that each symbol takes the space of only one code point (essentially a “letter”), for example being able to fit a full 50 non-Latin characters into an invoice item name. It also means that you’ll be able to use snowmen and other extended characters in the time tracking section of FreshBooks!

What this means for you as an API consumer: You can now send FreshBooks the full gamut of BMP characters directly as UTF-8 with no encoding shenanigans! Previously anything not in the ISO-8859-1 character set would be smashed into a question mark, including XML entities representing those extended charaters. As a workaround, one could “double-encode” entities, e.g. your XML would contain the ASCII string ☃ to get a snowman. This is no longer required!

Here’s how things work, starting today:

If you submit this via your browser It looks like this in the browser And like this in an API response
& & &
☃
☃ ☃ ☃
If you submit this via the API It looks like this in the browser And like this in an API response
& & &
☃
☃

For the next month or so we’ll continue to accept HTML entities through the web application (and double-encoded entities through the API), and display them just like we have for years. But after that, we’ll migrate all the exiting entity-based characters into real UTF-8 codepoints, and flip the switch such that plain text is plain text.

When that happens, the behaviour will change like this:

If you submit this via your browser It looks like this in the browser And like this in an API response
& & &amp
☃ ☃ ☃
☃ ☃ ☃
If you submit this via the API It looks like this in the browser And like this in an API response
& & &
☃
☃ ☃ ☃

Enjoy!