Solved

Delphi XE2 Disable Unicode

Posted on 2013-06-03
3
726 Views
Last Modified: 2013-06-03
How do you disable UNICODE on a file read with TFileStream, e.g.

InQue.TFileStream;

InQue.Read(InQRec.DataRec[0], Sizeof(QueueRecord));

InQue is a structure.

This works fine with Delphi 7.
0
Comment
Question by:davinci1942
  • 2
3 Comments
 
LVL 25

Expert Comment

by:Sinisa Vuk
Comment Utility
Works fine on D7 because it is not unicode supported in it. Can you go to my previous answer on similar question - just replace Utf8String word with AnsiString:
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_28139669.html
0
 

Author Comment

by:davinci1942
Comment Utility
My Structure:

   { Response file name is RESPONSE.USR }
   QueueRecord = Packed record
      DataRec:  array [0..MsgSize] of Char;   // Data Record ItSelf
      RxNumber: array [0..5]   of Char;        // Rx Number
      FillDate: array [0..7]   of Char;            // Date Rx Filled
      MsgID:    array [0..12]  of Char;           // Message ID
      BinNo:    array [0..5]   of Char;            // BIN # for dial
      User:     array [0..2]   of Char;             // User ID
      Mode:                       Char;                  // 'D' = Dial Up, 'I' = Internet
   end;

My read Statement:

            InQue.Read(InQRec.DataRec[0], Sizeof(QueueRecord));

Compiles fine under both Delphi7 and XE2, however the Delphi7 version returns valid data .. the XE2 version returns weird graphics looking characters, i.e. UNICODE.
0
 
LVL 25

Accepted Solution

by:
Sinisa Vuk earned 100 total points
Comment Utility
also replace Char in record with AnsiChar word and replace my record definition in example with your record definition.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now