Question

Background:

I'm working on a solution which will include writing data from multiple countries and reading from to the windows event log (e.g. if there's an exception processing a customer record I may include the customer's name in the description text to make it more human readable; customers' names are likely to require special characters from their language - and we will never take Prince as a customer).
I'm writing and reading as various systems in our business are writing whilst I'm defining the monitoring system which will be reading from & working with event log data.

I've looked on Google but can't find any relevant information on this. Looking at the XML view of Events there's no file header / encoding attribute defined. I'd assume it's UTF-8 in the later versions, but can't find this documented / would be surprised if older versions supported that encoding.

Questions:

  • What character set is used by the Windows Event Log?
  • Is it the same for all versions of Windows?
Was it helpful?

Solution

Per Hans Passant's comment:

All Windows winapi functions and internal data structures use utf-16 encoded strings, so does the event log. You could only get into trouble by using the legacy ReportEventA() function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top