I am making a web application that needs to work in both an English/Japanese environment. This web application is intended to manage a company website (news releases, add new companies), and also contains an admin section available to administrators only. During my coding process I did not realize the existence of the mbstring functions since I am still fairly new to PHP. I am attempting to change the mbstring settings in the php.ini file however, I am not sure if it will give me the desired results.
I prefer to work with UTF-8 as I want to leave some room for development in the future.
THINGS I HAVE DONE SO FAR
1. I have made sure that my php, html charsets are utf-8 by setting the character sets in both the php header() and html meta tags.
2. I have attempted to use the following php.ini settings
Expand|Select|Wrap|Line Numbers
- [mbstring]
- ; language for internal character representation.
- mbstring.language = Neutral
- ; internal/script encoding.
- ; Some encoding cannot work as internal encoding.
- ; (e.g. SJIS, BIG5, ISO-2022-*)
- mbstring.internal_encoding = UTF-8
- ; http input encoding.
- mbstring.http_input = "auto"
- ; http output encoding. mb_output_handler must be
- ; registered as output buffer to function
- mbstring.http_output = UTF-8
- ; enable automatic encoding translation according to
- ; mbstring.internal_encoding setting. Input chars are
- ; converted to internal encoding by setting this to On.
- ; Note: Do _not_ use automatic encoding translation for
- ; portable libs/applications.
- mbstring.encoding_translation = On
- ; automatic encoding detection order.
- ; auto means
- ;mbstring.detect_order = auto
- ; substitute_character used when character cannot be converted
- ; one from another
- ;mbstring.substitute_character = none;
- ; overload(replace) single byte functions by mbstring functions.
- ; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
- ; etc. Possible values are 0,1,2,4 or combination of them.
- ; For example, 7 for overload everything.
- ; 0: No overload
- ; 1: Overload mail() function
- ; 2: Overload str*() functions
- ; 4: Overload ereg*() functions
- ;mbstring.func_overload = 0
- ; enable strict encoding detection.
- ;mbstring.strict_encoding = Off
3. Replaced str functions with mbstr functions where necessary.
Is there anything else I MUST do or SHOULD do in order to make this application work the way I want it to?
(B)
Questions
I am an absolute newb in encodings, so I have a very newbish question. When I set the mbstring.internal_encoding to UTF-8, does that mean the encoding of the actual script is UTF-8?
I am also using mysql (planning to use mysqli later on). Are these functions safe to use with UTF-8?
I know this may be a big topic, and I am not expecting a complete answer, but any help at all would be greatly appreciated.
ENVIRONMENT:
OS: Windows XP MEDIA CENTRE (ENGLISH with IME)
PHP EDITOR: DREAMWEAVER CS3, ZEND STUDIO 5.5, and sometimes plan old NOTEPAD when I am not on my own computer.
SERVER: WAMP SERVER 2.0
HOST: Probably will use a shared hosting company