Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mb_convert_variables(3) [php man page]

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_CONVERT_ENCODING(3)							 1						    MB_CONVERT_ENCODING(3)

mb_convert_encoding - Convert character encoding

SYNOPSIS
string mb_convert_encoding (string $str, string $to_encoding, [mixed $from_encoding = mb_internal_encoding()]) DESCRIPTION
Converts the character encoding of string$str to $to_encoding from optionally $from_encoding. PARAMETERS
o $str - The string being encoded. o $to_encoding - The type of encoding that $str is being converted to. o $from_encoding - Is specified by character code names before conversion. It is either an array, or a comma separated enumerated list. If $from_encoding is not specified, the internal encoding will be used. See supported encodings. RETURN VALUES
The encoded string. EXAMPLES
Example #1 mb_convert_encoding(3) example <?php /* Convert internal character encoding to SJIS */ $str = mb_convert_encoding($str, "SJIS"); /* Convert EUC-JP to UTF-7 */ $str = mb_convert_encoding($str, "UTF-7", "EUC-JP"); /* Auto detect encoding from JIS, eucjp-win, sjis-win, then convert str to UCS-2LE */ $str = mb_convert_encoding($str, "UCS-2LE", "JIS, eucjp-win, sjis-win"); /* "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" */ $str = mb_convert_encoding($str, "EUC-JP", "auto"); ?> SEE ALSO
mb_detect_order(3). PHP Documentation Group MB_CONVERT_ENCODING(3)
Man Page

12 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to use ed ?

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)
Discussion started by: svennie
8 Replies

2. Programming

Point and Array Convert Problem

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)
Discussion started by: zhshqzyc
0 Replies

3. UNIX for Dummies Questions & Answers

character encoding in Fedora6

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)
Discussion started by: bsky
1 Replies

4. Shell Programming and Scripting

Difference between use vars and our variable in PERL

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)
Discussion started by: jatanig
3 Replies

5. Shell Programming and Scripting

dynamically echo-ing parameters

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)
Discussion started by: guessingo
1 Replies

6. HP-UX

how to find the character encoding of a file in hp_ux

how to find the character encoding of a file in hp_ux (1 Reply)
Discussion started by: alokjyotibal
1 Replies

7. UNIX for Dummies Questions & Answers

AIX and Linux difference (character set)

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)
Discussion started by: Jin_
1 Replies

8. Shell Programming and Scripting

How to check string encoding?

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)
Discussion started by: sanantonio7777
2 Replies

9. Shell Programming and Scripting

getting vars from external files

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)
Discussion started by: digitalviking
5 Replies

10. AIX

File enconding and conversion

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)
Discussion started by: Fundix
2 Replies

11. Shell Programming and Scripting

Perl Matching multiple variables

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)
Discussion started by: popeye
4 Replies

12. Ubuntu

Gcc cannot create executables

https://www.unix.com/302461112-post1.html Thank you. It's still in Linux Mint 17 (3 Replies)
Discussion started by: jgt
3 Replies