Solved

Delphi XE2 Disable Unicode

Posted on 2013-06-03
3
729 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 26

Expert Comment

by:Sinisa Vuk
ID: 39217563
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
ID: 39217580
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 26

Accepted Solution

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

911 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

27 Experts available now in Live!

Get 1:1 Help Now