0

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?
JohnLBevan
  • 22,735
  • 13
  • 96
  • 178
  • 1
    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. – Hans Passant Sep 06 '13 at 11:04
  • Fantastic, thanks Hans. If you put that in an answer I'll tick you the points. JB – JohnLBevan Sep 06 '13 at 12:41

1 Answers1

0

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.

JohnLBevan
  • 22,735
  • 13
  • 96
  • 178
  • 1
    A relevant link to documentation would be helpful. I found this https://learn.microsoft.com/en-us/windows/desktop/Intl/unicode but would hope for something more explicit... – Nagev Jun 11 '19 at 13:39