10-28-2008
Hi fpmurphy, thanks for the response.
can u pls elaborate on how and what locale do is set ? i am operating on solaris 5.8 OS.
also this is a part of the bigger problem. Actually i am transmitting the above character through a email message. so i extract this message from the mail server in unix, and decode it. What happens here is that the character is decoded as (Å´), which is actually 0xC5B4 annoted in ascii ( 0xC5 = Å, 0xB4 = ´).
So i want to take these (Å´) and convert to (Ŵ) directly or via their hex value (\xC5B4).
10 More Discussions You Might Find Interesting
1. Programming
While working with russian text under FreeBSD&MySQL I need to convert a string from MySQL to the Unicode format.
I've just started my way in C++ under FreeBSD , so please explain me how can I get ascii code of Char variable and also how can i get a character into variable with the specified ascii... (3 Replies)
Discussion started by: macron
3 Replies
2. Red Hat
Hello,
I am trying to convert a 7bit ASCII file to UTF-8.
I have used iconv before though it can't recognize it for some reason and says unknown file encoding.
When I used ascii2uni package with different package, ./ascii2uni -a K -a I -a J -a X test_file > new_test_file
It still... (2 Replies)
Discussion started by: rockf1bull
2 Replies
3. Shell Programming and Scripting
I have a shell script running to load some data from a text file to database. Text file contains some non-ASCII characters like ü. How can i convert these characters to UTF-8 codes before loading to DB. (5 Replies)
Discussion started by: vel4ever
5 Replies
4. Shell Programming and Scripting
can someone help me in converting hex streams to decimal values using perl script
Hex value:
$my_hex_stream="0c07ac14001676";
Every hex value in the above stream should be converted in to decimal and separated by comma.
The output should be: 12,07,172,20,00,22,118 (2 Replies)
Discussion started by: Arun_Linux
2 Replies
5. UNIX for Dummies Questions & Answers
Sometimes we recieve some excel files containing French/Japanese characters over the mail, and these files are manually transferred to the server by using SFTP (security is not a huge concern here). The data is changed to text format before transferring it using Notepad.
Problem is: When saving... (4 Replies)
Discussion started by: jawsnnn
4 Replies
6. Linux
Hi,
I have tried to convert a UTF-8 file to windows UTF-16 format file as below from unix machine
unix2dos < testing.txt | iconv -f UTF-8 -t UTF-16 > out.txt
and i am getting some chinese characters as below which l opened the converted file on windows machine.
LANG=en_US.UTF-8... (3 Replies)
Discussion started by: phanidhar6039
3 Replies
7. Shell Programming and Scripting
Hello all
i have utf-8 file that i try to convert to WINDOWS-1251 on linux
without any success
the file name is utf-8 when i try to do :
file -bi test.txt
it gives me :
text/plain; charset=utf-8
when i try to convert the file i do :
/usr/bin/iconv -f UTF-8 -t WINDOWS-1251 test.txt >... (1 Reply)
Discussion started by: umen
1 Replies
8. UNIX for Advanced & Expert Users
Hi All,
I am trying to obtain count of characters using awk, but "length" function returns a value of 1 for 2-byte or 3-byte characters as well unlike wc -c command.
I have tried to use the below commands within awk function, but it does not seem to work
{
cmd="wc -c "stringtocheck
( cmd )... (6 Replies)
Discussion started by: tostay2003
6 Replies
9. Shell Programming and Scripting
I am trying to develop a script which will work on a source UTF-8 file and perform one or more of the following
It will accept the target encoding as an argument e.g. US-ASCII or ISO-8859-1, etc
1. It should replace all occurrences of characters outside target character set by " " (space) or... (3 Replies)
Discussion started by: hemkiran.s
3 Replies
10. UNIX for Beginners Questions & Answers
Dears,
I have a shell script - working perfectly on Oracle Linux - that detects the encoding (the charset to be exact) of the files in a specified directory using the "file" command (The file command outputs the charset in Linux, but doesn't do that in AIX), then if the file isn't a UTF-8 text... (4 Replies)
Discussion started by: JeanM-1
4 Replies
LEARN ABOUT PHP
error_log
ERROR_LOG(3) 1 ERROR_LOG(3)
error_log - Send an error message to the defined error handling routines
SYNOPSIS
bool error_log (string $message, [int $message_type], [string $destination], [string $extra_headers])
DESCRIPTION
Sends an error message to the web server's error log or to a file.
PARAMETERS
o $message
- The error message that should be logged.
o $message_type
- Says where the error should go. The possible message types are as follows:
error_log(3) log types
+--+---------------------------------------------------+
|0 | |
| | |
| | $message is sent to PHP's system logger, using |
| | the Operating System's system logging mechanism |
| | or a file, depending on what the error_log con- |
| | figuration directive is set to. This is the |
| | default option. |
| | |
|1 | |
| | |
| | $message is sent by email to the address in the |
| | $destination parameter. This is the only message |
| | type where the fourth parameter, $extra_headers |
| | is used. |
| | |
|2 | |
| | |
| | No longer an option. |
| | |
|3 | |
| | |
| | $message is appended to the file $destination. A |
| | newline is not automatically added to the end of |
| | the $message string. |
| | |
|4 | |
| | |
| | $message is sent directly to the SAPI logging |
| | handler. |
| | |
+--+---------------------------------------------------+
o $destination
- The destination. Its meaning depends on the $message_type parameter as described above.
o $extra_headers
- The extra headers. It's used when the $message_type parameter is set to 1. This message type uses the same internal function as
mail(3) does.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
NOTES
Warning
error_log(3) is not binary safe. $message will be truncated by null character.
Tip
$message should not contain null character. Note that $message may be sent to file, mail, syslog, etc. Use appropriate conver-
sion/escape function, base64_encode(3), rawurlencode(3) or addslashes(3) before calling error_log(3).
EXAMPLES
Example #1
error_log(3) examples
<?php
// Send notification through the server log if we can not
// connect to the database.
if (!Ora_Logon($username, $password)) {
error_log("Oracle database not available!", 0);
}
// Notify administrator by email if we run out of FOO
if (!($foo = allocate_new_foo())) {
error_log("Big trouble, we're all out of FOOs!", 1,
"operator@example.com");
}
// another way to call error_log():
error_log("You messed up!", 3, "/var/tmp/my-errors.log");
?>
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.2.7 | |
| | |
| | The possible value of 4 was added to $mes- |
| | sage_type. |
| | |
+--------+---------------------------------------------------+
PHP Documentation Group ERROR_LOG(3)