Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8738905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:50:01+00:00 2026-06-13T10:50:01+00:00

Background: I’m working on a legacy code of a web application and I’m currently

  • 0

Background:

I’m working on a legacy code of a web application and I’m currently converting some of the ASCII parts of the code to UNICODE. I’ve run in to the following bug in the logger. it seems that string literals are either created or for some reason corrupted along the way.

Example the following string – "%s::%s - Started with success." In the memory it looks like this.

2AF9BFC   25 00 73 00 3A 00 3A 00  %.s.:.:.
02AF9C04  25 00 73 00 20 00 2D 00  %.s. .-.
02AF9C0C  20 00 53 00 74 00 61 00   .S.t.a.
02AF9C14  72 00 74 00 65 00 64 00  r.t.e.d.
02AF9C1C  20 00 77 00 69 00 74 00   .w.i.t.
02AF9C24  68 00 20 00 73 00 75 00  h. .s.u.
02AF9C2C  63 00 63 00 65 00 73 00  c.c.e.s.
02AF9C34  73 00 2E 00 00 00 00 00  s.......
02AF9C3C  00 00 00 00 00 00 00 00  ........

In the log the string will look as following -_S_t_a_r_t_e_d_ _w_i_t_h _s_u_c_c_e_s_s
Where space is represented here as usual and the NULL char is represented by _ (The _ is only an example, different txt editors will show it in a different way).

I do use the _T macro which is replaces the string to be Unicode from what I learn here.

Why do I get the byte 0 prefix?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:50:02+00:00Added an answer on June 13, 2026 at 10:50 am

    In Microsoft’s terminology, “Unicode” means UTF-16 i.e. each character is represented by either one or two 16-bit code units. When an ASCII character is converted to a UTF-16, it will be represented as a single code unit with the high byte zero and the low byte containing the ASCII character.

    If you want your log file to be readable as ASCII you need to convert your text to UTF-8 when writing it out. Otherwise, make sure that all text in the log file is UTF-16 and use a log file reader that understands UTF-16, but note that you’ll waste up to 50% space if most of your text is ASCII (since every second byte will be 0).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background : I'm trying to convert some JavaScript code which uses the the Crossfilter
Background info: We are currently 3 web programmers (good, real-life friends, no distrust issues).
Background: Some time ago, I built a system for recording and categorizing application crashes
Background Developing a simple web application (Eclipse + JBoss + Apache Tomcat) to generate
Background: My coworker and I are maintaining a million-line legacy application we inherited. Its
Background: We're building an application that allows our customers to supply data in a
Background I am working with a monad built of a stack of transformers one
Background: Using unix, codeigniter from localhost. I'd like to run a controllers via a
Background The main application where I work is based heavily on the MUMPS-esque Caché
Background: I have a Visual Studio solution consisting of a website + REST web-service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.