Tuesday 8 July 2014

.NET | Issue | CSV export giving corrupted chars for non english characters Â

Someone asked me today about an encoding problem they were having, its amazing, encoding issues have been around since the beginning of computers, the requirement to export international data to files or pages and having the reader interpret the characters correctly is pretty common, I would go so far as to say that about half of every big projects has some form of requirement around that.

So then we come to why the issue shows up? "Ive debugged and can see the data from the database is being shown correctly but when i export it to the response, the special characters come back as gobbledygook, even the pound symbol is coming back as '£'"

what do you do?

  1. Check the data in the database is stored correctly and it is getting to the response without being corrupted
  2. Check you are setting the ContentEncoding correctly, what do you need to use? UTF8 is always a good one to use if you are unsure
  3. Make sure you are using the right BOM (Byte Order Mark)! (this is nearly always the issue with unexplained chars with the correct encoding, see below

if you want to know more about BOM, have a look at this - http://en.wikipedia.org/wiki/Byte_order_mark

Friday 4 July 2014

Working with multiple Microsoft accounts (multiple 365 accounts)

it can be tiresome and confusing working with multiple microsoft accounts. there are countless scneario's where you will need to be logged in to more than one microsoft account at the same time, now the common way of doing this would be to use different browsers, IE and FIrefox or chrome for example, thats one way of doing it but that means you can only have a certain number of accounts, or using in private or incognito browsing but again, they all have limited usage and with the in private you will loose your credentials and history when you cose the window

Scenario's:
Using personal Live account and need to sign in with company account
Using company account and trying to sign in to company dev account
Using client account and trying to sign in with company account
the scenario's go on and on,

Enter Chrome Users....

Chrome has taken the title of best browser from firefox a few years back, it is quick, light and it works, for most web developers it is the browser of choice and thelist of reasons for that are as long as your arm.

chrome has another feature that most people arent aware of or using, this feature is perfect for using multiple accounts

Chrome Users

Setting up Users: he chrome site has all the information you need on setting up users here: https://support.google.com/chrome/answer/2364824?hl=en-GB

On my environment i need to mange four separate Microsoft accounts, for this I have created four users, my first user being my main intranet account:


on that account I have saved passwords and settings for that user, if I click to the "Py" account, a new window opens with that user icon, with that i am able to use all my saved settings and passwords for my "Py" 365 account


You can see when you have multiple windows up, the icon user indicator allows you to easily see which window is which, this works for as many users as you want.


I highly recommend using it for any one who has to manage more than one Microsoft account, it is brilliant and such a simple way of managing multiple accounts!