473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Specials chars replaced by strange chars

Hey, i got a small problem in PHP.
When i try to get some data from a file (fopen), it replaces special chars
by weird chars.

Example :
Français instead of Français.
thème instead of thême...

Anyone got an idea about how to correct this ?
THanks !!
Jul 17 '05 #1
2 1835
Nicolas Nguyen wrote:
Hey, i got a small problem in PHP.
When i try to get some data from a file (fopen), it replaces special chars
by weird chars.

Example :
Français instead of Français.
thème instead of thême...

Anyone got an idea about how to correct this ?


utf8_decode()

worked here ... but changed "thème" to "thème"
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
I havent looked into it, but a band-aid would be something like this

$s = strtr($s,"fF","rR");

This will repalce chr's one for one, the first chr in string2 will replace
all occurances of the first chr of string1
in the exmaple above, all f will become r and all F will become R

just an idea

--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Nicolas Nguyen" <pe*******@wanadoo.fr> wrote in message
news:c2**********@news-reader3.wanadoo.fr...
Hey, i got a small problem in PHP.
When i try to get some data from a file (fopen), it replaces special chars
by weird chars.

Example :
Français instead of Français.
thème instead of thême...

Anyone got an idea about how to correct this ?
THanks !!

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Max Bauer | last post by:
Hello! How can i write Chars like "²" or "$" on the DOS Window when the Programm is running? I've tried f.e. \178 but this ignores the "8". And i dont know why :(
4
by: dutch disCo | last post by:
Hi, I'm trying to use GET method to pass variables through my script files. Unfortunately, when a special char (&, ?, +) is being posted the variable gets trimmed in a very strange way. I'm...
4
by: Simon Schaap | last post by:
Hello, I have encountered a strange problem and I hope you can help me to understand it. What I want to do is to pass an array of chars to a function that will split it up (on every location where...
3
by: VMI | last post by:
When I execute a ReadLine from an ascii file with special chars (ie. the 'Ñ' in "NUÑEZ PEREZ"), it automatically deletes this character. So "NUÑEZ PEREZ" becomes "NUEZ PEREZ". How can this be...
5
by: Sean Kirkpatrick | last post by:
As part of my ongoing effort to provide a set of .Net wrappers for DAO, I'm writing a simple parser in VB.Net to search collection of VB6 source files to add explicit qualifiers to existing...
2
by: Viktor Barasov | last post by:
I am running an english Windows 2000. When I use InternetExplorer 6.0 to visit russian pages some of them are displayed correctly while other are not. Why? http://www.spb.ru/ for example is...
2
by: ImageAnalyst | last post by:
Tom, Nikolay: That code doesn't work, at least not in VS2005. What happens is that when you replace with VBNullChar, it basically chops off the string from that point onwards. So Sna?*|fu" would...
9
by: Matthew | last post by:
I'm using PHP version 4.4.3. The manual page for PHP's mail() function (URL below) says that for the message (IE. email body) "Each line should be separated with a LF (\n). Lines should not be...
13
by: Hongyu | last post by:
Hi, I have a datetime char string returned from ctime_r, and it is in the format like ""Wed Jun 30 21:49:08 1993\n\0", which has 26 chars including the last terminate char '\0', and i would...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
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...
0
agi2029
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.