MB_CONVERT_VARIABLES(3) 1 MB_CONVERT_VARIABLES(3)mb_convert_variables - Convert character code in variable(s)SYNOPSIS
string mb_convert_variables (string $to_encoding, mixed $from_encoding, mixed &$vars, [mixed &$...])
DESCRIPTION
Converts character encoding of variables $vars in encoding $from_encoding to encoding $to_encoding.
mb_convert_variables(3) join strings in Array or Object to detect encoding, since encoding detection tends to fail for short strings.
Therefore, it is impossible to mix encoding in single array or object.
PARAMETERS
o $to_encoding
- The encoding that the string is being converted to.
o $from_encoding
-$from_encoding is specified as an array or comma separated string, it tries to detect encoding from $from-coding. When
$from_encoding is omitted, detect_order is used.
o $vars
-$vars is the reference to the variable being converted. String, Array and Object are accepted. mb_convert_variables(3) assumes
all parameters have the same encoding.
o $...
- Additional $vars.
RETURN VALUES
The character encoding before conversion for success, or FALSE for failure.
EXAMPLES
Example #1
mb_convert_variables(3) example
<?php
/* Convert variables $post1, $post2 to internal encoding */
$interenc = mb_internal_encoding();
$inputenc = mb_convert_variables($interenc, "ASCII,UTF-8,SJIS-win", $post1, $post2);
?>
PHP Documentation Group MB_CONVERT_VARIABLES(3)
Check Out this Related Man Page
MB_DETECT_ENCODING(3) 1 MB_DETECT_ENCODING(3)mb_detect_encoding - Detect character encodingSYNOPSIS
string mb_detect_encoding (string $str, [mixed $encoding_list = mb_detect_order()], [bool $strict = false])
DESCRIPTION
Detects character encoding in string$str.
PARAMETERS
o $str
- The string being detected.
o $encoding_list
-$encoding_list is list of character encoding. Encoding order may be specified by array or comma separated list string. If
$encoding_list is omitted, detect_order is used.
o $strict
-$strict specifies whether to use the strict encoding detection or not. Default is FALSE.
RETURN VALUES
The detected character encoding or FALSE if the encoding cannot be detected from the given string.
EXAMPLES
Example #1
mb_detect_encoding(3) example
<?php
/* Detect character encoding with current detect_order */
echo mb_detect_encoding($str);
/* "auto" is expanded according to mbstring.language */
echo mb_detect_encoding($str, "auto");
/* Specify encoding_list character encoding by comma separated list */
echo mb_detect_encoding($str, "JIS, eucjp-win, sjis-win");
/* Use array to specify encoding_list */
$ary[] = "ASCII";
$ary[] = "JIS";
$ary[] = "EUC-JP";
echo mb_detect_encoding($str, $ary);
?>
SEE ALSO mb_detect_order(3).
PHP Documentation Group MB_DETECT_ENCODING(3)
hi all. the problem:
file contains a string like...
impossible mission
...now, that should be the impossible mission..
that means, I wanna make a string in front of the other strings but in the same line..
with vi it isn't a problem...easy.
but I wanna take the ed...
ed file
i... (8 Replies)
In this statement,"A" of type "int",being converted to "pointer toarray of int".(cvtdiftypes)
Please help me!
#include <stdio.h>
#include <stdlib.h>
int m,k;
const int max =20;
int A;
//****************************************************
// Input Matrix ... (0 Replies)
Hello,
After upgrading the OS from Fedora4 to Fedora6, the firefox
view>character encoding doesn't work anymore. None of the foreign
characters can be displayed, no matter what character encoding to
select.
Any suggestions?
Thanks,
bsky
:confused (1 Reply)
What is the difference between defining the global variable through our and using use vars ?
Is the variable created using our goes beyond even package scope?
Thanks in Advance !!! (3 Replies)
I have file called vars that has the following init
USER_DB="hello"
USER_DB2="hello2"
These are passwords
I source vars
. vars
But I have a script that will cycle through several databases, but each has its own password. So I need to build my password parameter.
. vars... (1 Reply)
I'm having a problem regarding the encoding of my files in Linux and AIX.
I have a file which can be viewed both in Linux and AIX (via NetApp mount). When I checked the encoding, they have difference.
In Linux, the file is encoded as ISO-8859 text. (checked by using "file" command).... (1 Reply)
I want to check if the string is WINDOWS-1251 or UTF-8
can you help me to find the string encoding???
or maybe to get URL Content-Type charset with wget?
this is my function on PHP
function check_utf8($str) {
$len = strlen($str);
for($i = 0; $i < $len; $i++){
$c =... (2 Replies)
Hi I have an issue, I want to get variables from an external file. Variable file var1=test var2-test2 I want to get these vars from another shell script. Does any one know how? (5 Replies)
Hi
am not a specialist about file encoding.
On an AIX 5.2.0.0, I need to check files encoding and convert somes of them to UTF-8.
I've used the following command and i think it said to me that all files are encoded using ISO8859-1
%locale charmap
ISO8859-1
I've also used iconv command... (2 Replies)
I am trying to match mulitple (3) variables. I found the sub given below on the web which works well when all vars are defined. But there are situations where one or two will not be defined (at least one will always be defined.)
Example of the variable content possibilities
The sub found... (4 Replies)