no, sorry, it is still not right, now the 'š' goes to the very end of the sorting:
but the 'u' are fine as you see.
I used the command "file" to check the file encoding, and it reports utf-8 for both the test file and the script file.
I have a stream of characters like "\u8BBE\u5907\u7BA1"
and i want to display it.
I tried following things already without any luck.
1) printf("%s",L("\u8BBE\u5907\u7BA1"));
2) printf("%lc",0x8BBE);
3) setlocale followed by fwide followed by wprintf
4) also changed the local manually... (3 Replies)
Hi,
Can I know how to grep for lines with non-ascii characters in a file?
If not grep, at least can we do it with command-line perl or awk? I tried the functionality of perl, but still could not get the result. Any help??
PS: I was sure that someone should have asked this question... (9 Replies)
Hello,
I am not a programmer, please be patient.
Actually, I have started to look into Perl because it seems to be able to solve all the problems (or most of them) I happen meet using my computer. These problems are generally all text-manipulation-related.
Although I started to study, I cannot... (6 Replies)
Hi gurus,
I have a file in unix with ascii values. I need to convert all the ascii values in the file to ascii characters. File contains nearly 20000 records with ascii values. (10 Replies)
Hello,
I was written a cgi with a textarea to save some words from web.
I grab and write words like this:
$cgiparams{'CONTENTS'} =~ s/\r//g;
#$cgiparams{'CONTENTS'} =~ s/á/á/g;
open(TM, ">$editedfilename");
#binmode(TM,... (1 Reply)
Hello,
My Perl script reads input from stdin and prints it out to stdout. After I read input I use BACKSPACE to erase characters. However BACKSPACE does not work with Unicode characters that are multi-bytes. On screen the character is erased but underneath only one byte is deleted instead of all... (3 Replies)
Hello,
When I run this UNIX code without the -t option it gives me the desired results.
The code keeps the record with the greatest datetime based on the key columns.
I sort it first then sort it again with the -u option, that's it.
I need to have a variable to specify an ASCII character... (2 Replies)
Hello,
I have a large file in UTF8 format with around 200 thousand plus strings which have a large number of scripts (code-blocks/code-pages).
I need to extract from the file only the following:
All strings having basic Latin characters: 0021-007E
All strings in the Devanagari range: 0900 to... (3 Replies)
I have a file in my Unix ( SOLARIS ) with EBCDIC format...I want this file to read in ASCII OR unicode...Is it possible with UNIX to convert this file on ASCII OR UNICODE format from EBCDIC format?
I was searching through web and found only conversion table :(
Request Rejected
Below is... (16 Replies)
Hi All,
I have an ascii file in which few columns are having hex values which i need to convert into ascii. Kindly suggest me what command can be used in unix shell scripting?
Thanks in Advance (2 Replies)
Discussion started by: HemaV
2 Replies
LEARN ABOUT PHP
fputcsv
FPUTCSV(3) 1 FPUTCSV(3)fputcsv - Format line as CSV and write to file pointerSYNOPSIS
int fputcsv (resource $handle, array $fields, [string $delimiter = ","], [string $enclosure = '"'], [string $escape_char = "
DESCRIPTION fputcsv(3) formats a line (passed as a $fields array) as CSV and write it (terminated by a newline) to the specified file $handle.
PARAMETERS
o $handle
-The file pointer must be valid, and must point to a file successfully opened by fopen(3) or fsockopen(3) (and not yet closed by
fclose(3)).
o $fields
- An array of values.
o $delimiter
- The optional $delimiter parameter sets the field delimiter (one character only).
o $enclosure
- The optional $enclosure parameter sets the field enclosure (one character only).
o $escape_char
- The optional $escape_char parameter sets the escape character (one character only).
RETURN VALUES
Returns the length of the written string or FALSE on failure.
CHANGELOG
+--------+---------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------+
| 5.5.4 | |
| | |
| | The $escape_char parameter was added |
| | |
+--------+---------------------------------------+
EXAMPLES
Example #1
fputcsv(3) example
<?php
$list = array (
array('aaa', 'bbb', 'ccc', 'dddd'),
array('123', '456', '789'),
array('"aaa"', '"bbb"')
);
$fp = fopen('file.csv', 'w');
foreach ($list as $fields) {
fputcsv($fp, $fields);
}
fclose($fp);
?>
The above example will write the following to file.csv:
aaa,bbb,ccc,dddd
123,456,789
"""aaa""","""bbb"""
NOTES
Note
If PHP is not properly recognizing the line endings when reading files either on or created by a Macintosh computer, enabling the
auto_detect_line_endings run-time configuration option may help resolve the problem.
SEE ALSO fgetcsv(3).
PHP Documentation Group FPUTCSV(3)