Delphi - problem with strings [Edit]

Hi,

I'm trying to make an application that connects to the specyfic device and read some data... thay are in strings...
Device producer give Delphi library that works but instead of number (string with number '1234.67') I get kind of chinesse letters..
if I do AnsiString := String there is '??????d'  string instead od chinnesse :-) with other string I get without last letter i.e.: 'Unknow'.

 http://i.imgur.com/jP47wgC.png

The library was made for Delphi 7 and is open in XE5...
In future I'd like to use it in FMX also...
0
Sebastian
2/27/2014 12:41:33 PM
embarcadero.delphi.firemonkey 4901 articles. 2 followers. Follow

1 Replies
403 Views

Similar Articles

[PageSpeed] 15

Sebastian wrote:

> I'm trying to make an application that connects to the specyfic device
> and read some data... thay are in strings...
>
> Device producer give Delphi library that works but instead of number
> (string with number '1234.67') I get kind of chinesse letters..

String is Ansi in D7, but is Unicode in XE5.  You canot read 8bit binary 
data using a UnicodeString.  Either use an AnsiString instead (and watch 
out for implicit codepage conversions!), or else change your reading to use 
a byte array instead.

> if I do AnsiString := String there is '??????d'  string instead od
> chinnesse :-)

That is invoking a conversion from UTF-16 to the OS default Ansi codepage. 
 But the source data is not UTF-16 to begin with.

> The library was made for Delphi 7 and is open in XE5...

Apparently it has not been updated to handle UncodeString correctly.

--
Remy Lebeau (TeamB)
0
Remy
2/27/2014 5:24:55 PM
Reply:

Similar Artilces:

SEPA components for Delphi with Source Code (Delphi 5
Hi all, in the european union change next year the Bankingformat to the SEPA Format. All peoples and companies must change the bankingssoftware and the costumer data form acountnummers in the new IBAN and BIC numbers. See: http://www.arma-it.de/shop/artikelueber.php?wgruppeid=211&wgruppe_offen=211 Functions: - generate SEPA XML'S - Calc IBAN - BIC Database (DE,AT and CH) Questions: vertrieb@arma-it.de PS: Bankinssoftware for Develpoers (Germany only) http://www.arma-it.de/shop/artikelueber.php?wgruppeid=212&wgruppe_offen=212 El 26/10/13 21:38, A...

New to Delphi
Hi I am new to Delphi & want to know good resources for learning to use it. Is there a list of good Delphi learning resources (books/online tutorials) somewhere? What recommendations can anyone make for someone new to Delphi (& only a hobby programmer at the moment)? A couple of weeks ago I started with DelphiXE4 trial & have Googled for a few Delphi resources but I haven't found anything very good yet for me as a beginner. I'm just struggling along trying to learn as I go! (I'm presently struggling with DragandDrop...see [http://stackoverflow.com/questions/17232...

Convert Delphi 7 to Delphi 2009 [Edit]
Hi! Please, I have a code done in Delphi 7... Now I want to convert Delphi 7 to Delphi 2009 but I'm having problems when compile the code. Error message: +[DCC Fatal Error] Far.dpr(9): F2063 Could not compile used unit 'System.pas'+ Please can somebody help me? Source Download (349KB): http://rapidshare.com/files/256191328/FileManager.rar.html Mirror Source Download: http://www.megaupload.com/?d=12GYLPT0 Password: delphi Thank u so much! (sorry for my bad english, it is not my native language) Edited by: loquax loquax on Jul 15, 2009 12:24 PM Sorry, bu...

Migrating from Delphi 6 to Delphi XE 3! [Edit]
All, I am a Delphi developer working in an windows form application developed using Delphi 6. Now, we are planning to upgrade the development tool. Can anyone provide me information related to major roadblocks that we can face while migrating from Delphi 6 to Delphi XE 3? Should we migrate to Delphi XE 3 or any other preferred version of Delphi based on the fact that our target users will be using Windows 7 or Windows 8? Do we have any tools or utilities to migrate the source code from Delphi 6 to higher version of Delphi? Also, any suggestions related to best practices are welcome....

Delphi 7 to Delphi XE: TBlobField to XML [Edit]
Hi, I'm migrating a Delphi7 application to Delphi XE. I'm using a TClientDataSet to communicate, by using a XML frame, with my server. In this TClientDataSet I'm using a TBlobField which is an array of 384 byte. The blobField is allocate by a code like this : {code} myStream : TStream; myStream := aClientDataSet.CreateBlobStream(myBlobField, bmwrite); vResult := myStream.Write(ArrayOf384Byte[0], length(ArrayOf384Byte)); //vResult = 384 => GooD ! (...) {code} For communicate with the server, we have to decode the Blobfield in XML before to sending it. We have...

Delphi 5 (string[80]) vs Delphi XE
Hi guys i'm trying to convert a old application made with Delphi 5 to Delphi XE 5 The probleme i have right now is about String[80] and the Read / Write procedure i have a type like that Type TEnrMess = record Mess : String[80]; MessSuiv : Word; Hint : Word; end; And i read/write this type to a File of TEnrMess My probleme is that the string have changed from Delphi 5 to Delphi XE i join the link of a simple of the probleme that can be compiled on delphi 5 and any Delphi XE https://mega.co.nz/#!wV1VyZzY!1ha5oOxTg7L1WJAOXutUygkj...

Delphi vs Winform
This might be a little techie, but I think most people here are familiar with Delphi to understand the difference between a TWinControl and TGraphicControl. I was trying to create a C# Winform project based on a Delphi prototype and ran into this problem which I posted to some Winform forums ... This led me to an *obvious* deficiency in Winforms programming. I'd like to hear your thoughts. My question to the Winforms forums describing the problem is copied below: <snip> Hi, I mostly do Delphi development but would like to start my next small work project in Visual S...

Code works in Delphi 7 but not in Delphi 2010 [Edit]
hello, i have a procedure that open's a file by passing the file name as the parameter to the executable. something like this {code} C : \ P r o g r a m F i l e s \ Da c k e r \ D r a c k e r . e x e " G : \ D E l p h i 7 \ D e l p h i 7 A p p _ l o g . t " {code} The source code is {code} procedure OpenFileWithExe var hReg: HKEY; Ret: Longint; RegDataType, RegDataSize: DWORD; CmdLine: array [0..560] of Char; Len: Integer; SInfo: TStartupInfo; PInfo: TProcessInformation; begin Ret := windows.RegOpenKeyEx(HKEY_CURRENT_USER, ...

Update Delphi 2005 to Delphi 2010, which do i need? [Edit]
Hello, we have one Delphi 2005 Professional here and want to upgrade to Delphi 2010, but we are a bit confused. Our distributor in Germany, ingram-micro offers several upgrade products: UPG DELPHI 2010 PRO - NAMED USER UPG DELPHI 2010 PRO - NAMED USER ELS UPG DELPHI 2010 PRO - NAMED USER FLEX RAD STUDIO 2010 PRO - UPG UPG RAD STUDIO 2010 PRO - NAMED ELC UPG RAD STUDIO 2010 PRO - NAMED FLEX UPG DELPHI 2010 PRO - CONCURRENT ELS UPG DELPHI 2010 PRO - CONCURRENT FLEX What do they mean exactly and which one do i need? At the moment delphi is installed on two PCs and we want to use ...

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

ShowMessage/MessagDlg wordwrap Delphi 2006
Hi, I have used Delphi 2006 up to now. ShowMessage allowed a long text without a word wrapping. Now with Delphi XE I notice that a migrated program shows smaller message window sizes and a previously carefully aligned message now appears wrapped and misaligned. How to get back to the previous behaviour? I'm not experienced to create my custom form, so a code snippet may help. Thanks, Uli Edited by: Ulrich Brueggemann on Sep 18, 2010 8:46 AM > I have used Delphi 2006 up to now. > ShowMessage allowed a long text without a word wrapping. > > Now with Delphi ...

Text.Write speed
Hi ! I have speed troubles for using Text.Write method in Delphi 2006, particularly with distant files (local network). For example, with the following code ("F" is a text file ; "Line" is an about 200-character string): ----- AssignFile(F, FileName); try Rewrite(F); for l := 1 to 100 do begin for c := 1 to Length(Line) do Write(F, Line[c]); Writeln(F); end; finally CloseFile(F); end; ----- On a distant file: Delphi 5 -> 0.08 seconds Delphi 2006 -> close to 8 seconds Is there a speci...

Delphi long string, not RAD.. at all [Edit]
Hi, I'm using Delphi XE8, but this apply to the very first turbo pascal 1.0 <g> The delphi way to handle long string ( more than 255 chars ) is to split with '+' in each line. {code} const _my_long_string = 'Some line'+ 'Some Another line'+ 'Some extra line'+ .... 'Last one'; {code} In database application, some queries have 220 lines that must be combined with "%s" and "%d" and someti...

Delphi 2010 produces much larger binaries than Delphi 2009 [Edit]
When I compile my project with Delphi 2010 the resulting executable is about 30% larger than the one compiled with Delphi 2009. Both binaries are compiled with the same source code and project options. The size of individual DCU files increases by 5-20%. Has anybody experienced similar results? Has anybody an idea what could cause this? It surprises me, as the changes in syntax and VCL have not been that big. Best regards, Joachim Edited by: Joachim Marder on Sep 25, 2009 6:07 AM "Joachim Marder" wrote in message news:166152@forums.codegear.com... > When I compi...

Access to legacy (Delphi 4) Midas server from Delphi XE2 [Edit]
Hello, My company biggest product is developped with Delphi 4 and uses several Midas servers. It's a really big application (still in evolution, since 1997) , that has been started with Delphi 3. A partial or complete rewrite of this application is planned in a mid term future, and I must study if we can envisage a soft migration of some parts of the software on Delphi XE2 (or XE4), or if a complete rewrite even of the servers parts is required. If a complete rewrite must be done, my boss doesn't exclude to study the possibility of using another development environment to rewri...

Web resources about - Delphi - problem with strings [Edit] - embarcadero.delphi.firemonkey

Is–ought problem - Wikipedia, the free encyclopedia
The is–ought problem in meta-ethics as articulated by Scottish philosopher and historian David Hume (1711–76) is that many writers make claims ...

State of the Service report: Not enough people moving, engagement and sickies the big problems
The rundown of the problems and good points for 150,000 federal public servants.

The Fitz Files: NRL decision about Sam Burgess deal with South Sydney exposes problem with salary cap ...
Let us call the salary cap what it is: an illegal cartel between employers to limit the earning capacity of its employees.

Dick’s Sporting Goods athleisure problem - Business Insider Deutschland
Dick's Sporting Goods has sold athletic apparel for decades. But now, the retailer faces more competition than ever.

November 2015: Unofficial Problem Bank list declines to 255 Institutions
This is an unofficial list of Problem Banks compiled only from public sources. Here is the unofficial problem bank list for November 2015. Changes ...

Trump loss equals Trump problem
Even if Donald Trump loses in Iowa, his success thus far will still present a problem for the GOP, Politico's Ben White says.

Tri-Valley has no problem against Auburn to win 2A title
... form Search 39° Navigation Home Blackhawks Bulls Cubs White Sox Bears Fire Notre Dame Preps More Tickets Shop Watch Tri-Valley has no problem ...

This week in the war on workers: Rising federal taxes aren't the problem for the middle class
Turns out, federal taxes on the middle class aren’t so high these days: Note that the figure includes all federal taxes—the income tax rate ...

SAP Jam Work Patterns Add Context to Processes Like Corporate Learning, Customer Problem Solving
When Marriott International picked SAP Jam, the global hotel chain was looking for a better way of organizing corporate training and learning ...

Family evicted, building deemed unlivable: Landlord cannot fix problems, he was murdered
... A Milwaukee family has been forced to leave their apartment. Their building has been declared unlivable. The landlord was required to fix problems ...

Resources last updated: 12/1/2015 12:16:56 AM