[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Load an SQL script to a memo

Posted on 2004-11-08
7
Medium Priority
?
239 Views
Last Modified: 2012-05-05
I try to load an sql script into an memo but all I get in the memo is some strange characters:

ÿþi


Can someone tell me how to do.
0
Comment
Question by:pucko
7 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 12523040
where comes the script from?
0
 
LVL 1

Author Comment

by:pucko
ID: 12523077
Generated from an Microsoft SQL server.

I think the problem is that it's in unicode. ( that's what notepad says if I open it and save it.)

And it looks ok in an TntMemo. (but I prefere to use an TMemo in this case.

So I guess that the Question should be how to convert unicode to ansi string.
0
 
LVL 6

Expert Comment

by:bpana
ID: 12525954
you cannot
all Delphi VCL is not unicode compliant
just use TntMemo
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:pucko
ID: 12527039
What do you mean?  It must be possible to convert an unicode text to an ansi text? (and the reverse).

And why should the DELPHI vcl have to be Unicode compilant to write an Unicode to ansi routine?
 
0
 
LVL 1

Expert Comment

by:SJohnson
ID: 12529161
There's always ways of converting things :)  You've just got to know what you're converting from first :)

Try this function:

WideCharLenToString

from the Help:
Converts Unicode characters to single or multi byte character data.

Stu.
0
 
LVL 4

Accepted Solution

by:
Mikho earned 375 total points
ID: 12532731
or use  WideCharToString if the unicode string  is null-terminated


also from the help file

WideCharToString converts the given null-terminated Unicode string to a string made up of single- or multi-byte characters.
0
 
LVL 4

Expert Comment

by:Mikho
ID: 12552827
thank you for the points.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Screencast - Getting to Know the Pipeline
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

872 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