(A)
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 -
[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.intern al_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
1 2573 pbmods 5,821
Recognized Expert Expert
Heya, Clai.
You should be good to go from there. PHP 6 will have greatly-enhanced Unicode support, but for now, you're doing all you can.
I am an absolute newb in encodings, so I have a very newbish question. When I set the mbstring.intern al_encoding to UTF-8, does that mean the encoding of the actual script is UTF-8?
Nope. That one is set by your text editor.
I am also using mysql (planning to use mysqli later on). Are these functions safe to use with UTF-8?
Yup.
Be sure to set your connection encoding when you connect to MySQL: -
mysql_query("SET NAMES 'utf-8'", $conn);
-
mysql_query("SET CHARACTER SET 'utf-8'", $conn);
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Benoit Martin |
last post by:
in my windows app, I have some japanese text that I load from a text file
and display on a label. No matter what type of encoding I try to use on the
text file, the text always comes up as a bunch of unreadable characters on
my label.
Are there settings/properties for a label on a windows form to be able to
read japanese text? Is it when I raed the file that it gets screwed up (I
use fileOpen and LineInput)?
Looking for pointers here
|
by: Fred Flintstone |
last post by:
I'm writing a VB.Net windows forms application. This line of code:
Personal.EffectiveDate = GridRow2.Cells("New
Value").Value.ToString.Trim
Fails with this error:
Cast from string "8/23/2005" to type 'Date' is not valid.
The date being returned is in US English and my system is set for
|
by: ShK |
last post by:
Hi,
phpMyAdmin gives following error message: "The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results."
So, how I can enable that feature?
I try it like this: I copy php_mbstring.dll:n to C:\PHP-folder and edit C:\Windows\php.ini -file: 'extension=php_mbstring.dll', but it didnt remove...
|
by: news |
last post by:
After installing phpMyAdmin on my Fedora Core 4 box, (Apache 2.0.54,
PHP 5.0.4) we're getting this error:
"The mbstring PHP extension was not found and you seem to be using a
multibyte charset. Without the mbstring extension phpMyAdmin is unable
to split strings correctly and it may result in unexpected results."
The phpinfo() has no reference to mbstring.
Doing some searching, I found some information regarding php.ini and...
|
by: Earl77 |
last post by:
My Son bought a toshiba laptop in Japan when he was teaching school over there, when he returned just recently to the Usa he wants to change the windows xp from Japanese to English. A person by the name of Cyberdyne answered a question and said he knew how.
Can he help me?? some advice I have seen says yes it can be done but you will still have a lot of driver problems and garbled text and advised buying a new laptop. However my son paid...
| |
by: Pratik Patel |
last post by:
Hi,OpenPNE is open source japanese social network. AND it's also have
facility to transfer language in english in next version.but i see two
site which is translated in english. can anyone help to me to
translate site in japanese to english and also working in japanese.
see information regarding openPNE http://openpne.jp
|
by: =?Utf-8?B?ZGVuIDIwMDU=?= |
last post by:
hi,
I trying to export data display on a gridview that supports any language
(like chinese, japanese, thai, french) shown here is chinese only. There is
no problem exporting english language data, problem starts exporting
non-english data using approach shown below, the data is retrieve in database
in an xml format. Is there a simple way to be able to make this work?
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
by: Steve Howell |
last post by:
The never-ending debate about PEP 3131 got me thinking
about natural languages with respect to Python, and I
have a bunch of mostly simple observations (some
factual, some anecdotal). I present these mostly as
food for thought, but I do make my own
continent-by-continent recommendations at the bottom
of the email. (My own linguistic biases are also
disclosed at the bottom of the email.)
Nationality of various technologists who use...
|
by: Ole Nielsby |
last post by:
Does C++ have a method of retrieving this?
When launching my app, I want to select the appropriate language
for ts GUI, based on the user's language setting.
The frameworks wxWidgets and OpenOffice UNO have this
functionality but the wxWidgets code is a mess of platform
specific #ifdef sections. I wonder i there is a standard compliant
way.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |