ansi

How to remove ANSI-Code (“
”) from string in PHP

▼魔方 西西 提交于 2019-12-06 14:46:06
问题 I have tried a lot but nothing is working. I want to import a XML-file with PHP. In some strings the customer puts some ANSI-Code Carrier Returns (" "). I have tried to remove them with: str_replace('\r', '', $xml->description); I also tried it with "&\#13;" , "\r\n" , "\&\\#13\;" in the search but nothing works. Do you have any idea how to remove these linebreaks? Thanks! 回答1: Since your XML processor is already handling de-entitying the entities, you'll be left over with plain ASCII \n or

gSoap generated client-side structure initialization and use

偶尔善良 提交于 2019-12-06 14:23:33
问题 gSoap generated client-side structure initialization and use (using ANSI C bindings) First of all, I searched and although there are a number of struct initialization solutions offered, I did not find anything directly answering this issue. Also, this question is being posted simply to assist anyone else that has a similar question, as I have already worked out the solution and because of my newbie status will post it immediately at least 8 hours after posting this. However, I am still very

ANSI color Set Graphics Rendition breaking mid-batch and working after it proceeds

一曲冷凌霜 提交于 2019-12-06 07:59:42
问题 I've got a batch that has a sub-section which iterates through lines of a file for EXEs to try running, and then the batch sorts the EXEs based on their exit codes. For some reason, the ANSI SGR seems to break or echo the literal text after setting the graphics rendition of the previous one instead of re-rendering it. I went back to re-reference this question and the original documentation, but I'm not sure why this specific area of my batches is mangling the ANSI coloration inside the

Colored console output in Linux

ε祈祈猫儿з 提交于 2019-12-06 07:38:13
问题 I just started learning programming in C. the first problem was to choose on which platform should I learn it, and I selected Ubuntu. I found a GCC compiler to compile my projects, and it worked fine for me. I was running my compiled projects through Terminal. But when I wanted to write a program which have to show a text on a colorful background, I understood that Terminal is not helping me. Actually I am learning from lessons written for programming on Windows, and they use there Borland C+

Characters with ASCII > 128 are not correctly read in Javascript

試著忘記壹切 提交于 2019-12-06 06:55:38
问题 I have a HTML that includes a Javascript file. This script contains a special character, ASCII 152. When I try to display the charCodeAt, I get different results, but never the right one. Could you please advice? Thanks TEST.HTML <script type="text/javascript" charset=SEE BELOW src="test.js"> </script> TEST.JS file with ANSI encoding function d(a) { a=(a+"").split(""); alert(a[1].charCodeAt(0)); }; d("i˜g"); // Note that ˜ is 152 in ASCII TEST.HTML with x-user-defined charset: alert shows

Issue getting ANSICON working on Windows 7 Enterprise 64-bit

百般思念 提交于 2019-12-06 04:23:41
问题 I have been trying to get 1.50 or 1.40 ANSICON (https://github.com/adoxa/ansicon) working and have looked at sooooo many pages telling about how to install this: http://blog.mmediasys.com/2010/11/24/we-all-love-colors/ http://carol-nichols.com/2011/03/the-system-cannot-find-the-path-specified/ etc.... So, I have my AutoRun set to "C:\usr\bin\ansi140\x64\ansicon.exe" -p and I also testing 150 but there was zero change. My entire team has this working with no issues but I cannot get this to

PHP: Converting UTF-8 string to Ansi?

蓝咒 提交于 2019-12-05 06:49:09
I build a csv string from values I have in my DB. The final string is stored in my $csv variable. Now I offer this string for download, like this: header("Content-type: text/csv"); header("Content-Disposition: attachment; filename=whatever.csv"); header("Pragma: no-cache"); header("Expires: 0"); echo $csv; When I open this in Notepad++ for example, it says Ansi as UTF-8 . How can I chnage that to Ansi only? I tried: $csv = iconv("ISO-8859-1", "WINDOWS-1252", $csv); That did not change anything. Thanks! Solution: $csv = iconv("UTF-8", "WINDOWS-1252", $csv); Try: $csv = iconv("UTF-8", "Windows

Widestring to string conversion in Delphi 7

若如初见. 提交于 2019-12-05 06:09:32
my app is a non-unicode app written in Delphi 7. I'd like to convert unicode strings to ANSI with this function : function convertU(ws : widestring) : string; begin result := string(ws); end; I use also this code to set the right codepage to convert. initialization SetThreadLocale(GetSystemDefaultLCID); GetFormatSettings; It works great in the VCL main thread but not in a TThread, where I get some questions marks '?' as result of function convertU . Why not in a TThread ? Calling SetThreadLocale() inside of an initialization block has no effect on TThread . If you want to set a thread's locale

Is there a way to create an Orange color from ANSI escape characters?

不打扰是莪最后的温柔 提交于 2019-12-05 06:01:13
I am looking for a control code to create orange text in a terminal using ANSI or some other standard, is this possible? I only see yellow and red available, and I don't think you can mix red and yellow for the same character :) Strictly speaking, no: ANSI never standardized anything (for a terminal's control sequences) which was called "orange". Some terminals can do this, but that lies outside the scope of the standards. xterm (see XTerm Control Sequences ) uses control sequences following the "ANSI" (actually withdrawn from standardization long ago) ECMA-48 syntax. Some of those are the

ANSI C - Clearing a string

混江龙づ霸主 提交于 2019-12-05 04:45:37
问题 I've got a string declared like this: str=malloc(sizeof(char)*128); I want to clear it completely so that whenI do strncat() operation, the new characters will be written to the beginning of str . The reason I need to clear it is that I'm writing over it with a simplified version of itself (deleting excess whitespace). 回答1: I suggest you simply do this: *str = '\0'; You don't need to clear the entire contents of the buffer. You can just set the first char to zero and then you have the empty