?
Solved

Delphi XE2 Disable Unicode

Posted on 2013-06-03
3
Medium Priority
?
745 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

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 27

Accepted Solution

by:
Sinisa Vuk earned 400 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

777 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