ansi

Writing ANSI string to Unicode file over FTP

三世轮回 提交于 2019-12-01 21:56:45
问题 I have the following Visual Basic 6.0 function which writes an ANSI string to a new file over FTP. I would like it to write the file as UTF-16LE. Is there any good way to do that within this following method? Public Sub writeToFile(ByVal FTPServer As String _ , ByVal userName As String _ , ByVal password As String _ , ByVal contents As String _ , ByVal destinationFile As String) Dim hFile As Long Dim lCount As Long inetOpen inetConnect FTPServer, userName, password hFile = apiFtpOpenFile(m

Non-ASCII characters in C

↘锁芯ラ 提交于 2019-12-01 17:47:06
I was looking at google go's runtime source code (at https://go.googlecode.com/hg/src/pkg/runtime/ ), and it seems they use a special character for their function names, · . (Look for example at https://go.googlecode.com/hg/src/pkg/runtime/cgocall.c ). Is this accepted across major compilers? It's not ANSI C, is it? Or is it just some macro magic? Thank you! C90 doesn't allow additional character in identifier (over those in the basic characters set), C99 do (both with the universal character syntax -- \uXXXX and \UXXXXXXXX -- and an implementation defined set of other characters). 6.4.2.1/1

Setting Visual C++ Studio/Express to strict ANSI mode

こ雲淡風輕ζ 提交于 2019-12-01 17:00:50
问题 I generally program & compile under Linux with gcc and -ansi flag; but I've been forced with doing a job in Visual C++ and whenever I compile my C code I get all the Microsoft warnings like 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. I get these despite following some steps on MSDN Developer's site for setting up an ANSI C project, but all the _s ("secure") calls are not ANSI C! Any suggestions on putting Visual C++ Studio in a strict ANSI-only mode?

VIM Unix commands printed in color

邮差的信 提交于 2019-12-01 16:52:56
I'm using MacVim and I would like to have ! commands printed in color. For example: In bash, the following echo statement prints Hello World in green (as expected): $ echo -e "\033[32m Hello World" Hello World However, in VIM the output is not color, and the escape codes are printed: :!echo -e "\033[32m Hello World" [32m Hello World How can one have VIM (and MacVim build 57 in particular) print the output of ! commands and honour ANSI color escapes. You can't. But you can suspend the editor and drop to a shell relatively quickly; Or you can use Ansi Filter to remove the escape sequences so you

Loading RTF text from database into TRichEdit

心已入冬 提交于 2019-12-01 16:44:35
问题 I am currently in the process of migrating our software solution from Delphi 7 to 2010. Mostly the changes have been simple and there are only a small amount of hurdles left to go. On a form we use a TRichEdit which displayed rtf text grabbed from a blob field in a MSSQL db. This is how it worked in Delphi 7: //Get RTF text from Blob field using TADOQuery rtfStream := sql.CreateBlobStream(sql.FieldByName('rtftext'), BmRead) as TMemoryStream; //Load into TRichEdit RichEdit.PlainText := False;

Converting problem ANSI to UTF8 C#

纵饮孤独 提交于 2019-12-01 16:27:16
I have a problem with converting a text file from ANSI to UTF8 in c#. I try to display the results in a browser. So I have a this text file with many accent character in it. Its encoded in ANSI, so I have to convert it to utf8 because in the browser instead of the accentchars appearing "?". No matter how I tried to convert to UTF8 it was still a "?". But if I convert the text file in notepad++ to utf8 then the accent chars are desplayed good. here is a peace of encoding code that I made: public string Encode(string text) { // encode the string as an ASCII byte array byte[] myASCIIBytes =

Converting problem ANSI to UTF8 C#

会有一股神秘感。 提交于 2019-12-01 15:00:54
问题 I have a problem with converting a text file from ANSI to UTF8 in c#. I try to display the results in a browser. So I have a this text file with many accent character in it. Its encoded in ANSI, so I have to convert it to utf8 because in the browser instead of the accentchars appearing "?". No matter how I tried to convert to UTF8 it was still a "?". But if I convert the text file in notepad++ to utf8 then the accent chars are desplayed good. here is a peace of encoding code that I made:

Using strtol to validate integer input in ANSI C

て烟熏妆下的殇ゞ 提交于 2019-12-01 10:39:09
I am new to programming and to C in general and am currently studying it at university. This is for an assignment so I would like to avoid direct answers but are more after tips or hints/pushes in the right direction. I am trying to use strtol to validate my keyboard input, more specifically, test whether the input is numeric. I have looked over other questions on here and other sites and I have followed instructions given to other users but it hasn't helped me. From what I have read/ understand of strtol (long int strtol (const char* str, char** endptr, int base);) if the endptr is not a null

C Primer Plus 第9章 函数 9.2 ANSI C 的函数原型

蓝咒 提交于 2019-12-01 09:55:28
9.2.1 产生的问题 下面我们讨论几个使用imax()函数的例子,该函数和imin()类似。在程序清单9.4中的程序以旧的形式声明函数imax(),然后错误的使用该函数。 程序清单9.4 misuse.c程序 /*misuse.c --不正确的使用函数*/ #include <stdio.h> int imax(); /*旧式的函数声明*/ int main(void) { printf("The maximum of %d and %d is %d.\n", 3,5,imax(3)); printf("The maximum of %d and %d is %d.\n", 3,5,imax(3.0,5.0)); return 0; } int imax(n,m) int n,m; { int max; if(n>m) max=n; else max=m; return max; } 在第一个printf()中调用函数imax()时漏掉了一个参数,而在第二次调用imax()时使用了浮点参数而不是整数参数。尽管存在这些错误,该程序仍可以编译执行。 程序运行时发生了什么?不同操作系统的内部机制不同,所以出现错误的具体情况也不相同。当使用PC或VAX时,程序执行过程是这样的: 调用函数首先把参数放在一个被称为堆栈(stack)的临时存储区域里,然后被调函数从堆栈中读取这此参数

Saving a Linq to Xml file as ANSI instead of UTF-8 in C# (Ivy)

点点圈 提交于 2019-12-01 07:33:43
In C#, I need to create XML files for use with Ivy and NAnt, but am having difficulty in getting the right encoding in the output file. If I use XElement's .Save("C:\foo.xml"), I get the correct looking file, but Ivy and/or NAnt gets upset, as the file is actually saved using UTF-8 but I actually need to save it as ANSI in order to be able to use it. I have a bodge in place at present, which is to use .ToString() to get the text and then use a StreamWriter to write it to a file. Ideally, I'd like to set the format during the .Save() but can't find any information on this. Thanks. XDocument