Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Delphi XE2 Disable Unicode

Posted on 2013-06-03
3
Medium Priority
?
758 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 28

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 28

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

604 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