Solved

Delphi XE2 Disable Unicode

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

828 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