473,666 Members | 2,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with utf8

hi people,

i have a script :
<?
$num=0;
$backendURL = "http://rezo.net/backend/afp";

$limit = 1; // nombre maxi de news à afficher.

$file = fopen( $backendURL, "r");
if( $file ) {
$raw = fread( $file, 32000 );
fclose( $file );
if( eregi("<item>(. *)</item>", $raw, $rawitems ) ) {
$items = explode("<item> ", $rawitems[0]);
$nb = count($items );

eregi("<title>( .*)</title>",$items[$num+1], $title);
eregi("<link>(. *)</link>",$items[$num+1], $link);

$tp2=$title[1];
$tp3=$link[1];
}
} else {
$tp2="Pas de news";
}

$tmp="info0_txt =".$tp2."&info0 _lien=".$tp3;
$tmp=utf8_encod e($tmp);
echo $tmp;

?>

But the text isn't encoded by $tmp=utf8_encod e($tmp);
IF I retrieve data from a base (mysql) that 's work !! WHY ?!
Jul 17 '05 #1
0 1911

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

Similar topics

4
5042
by: sinasalek | last post by:
i have a problem with MySQL 4.1.x and UTF8. in version 4.0, i'm using html forms with utf8 charset for inserting unicode strings. but in version 4.1.x it is not working! if i change the charset of column, ALTER TABLE `icons` CHANGE `name_farsi` `name_farsi` VARCHAR( 99 ) CHARACTER SET utf8 COLLATE utf8_persian_ci DEFAULT NULL and change default charset of database like below code :
10
4974
by: Achim Domma | last post by:
Hi, I read a webpage via urllib2. The result of the 'read' call is of type 'str'. This string can be written to disc via file('out.html','w').write(html). Then I write the string into a Memofield in an Access database, using adodbapi. If I read the text back I get a unicode string, which can not written to disc via file(...) due to encoding problems. How do I have to decode the unicode string to get my original data back?
0
3406
by: TJO | last post by:
Can someone at MS please reply to this. I am trying to post data so a web form via ssl with the following code. I keep getting this error: "The underlying connection was closed: Could not establish secure channel for SSL/TLS" private void mainHttpCalls(string postData) { HttpWebRequest objRequest1 ; HttpWebRequest objRequest2 ;
1
2201
by: Frank Esser | last post by:
Hello! On a PC with German Codepage settings I want to get UTF8 out of string in my application. I use this function: Byte array = Encoding.UTF8.GetBytes("à"); When I look at the Unicode tables then this character is in the Latin table
2
2627
by: Jim Lawton | last post by:
Hi, ..net c# httphandler straight html form at browser. GBP pound sign problem (I know I know - I *can* decode it, but I've got to understand what and why I should be doing stuff) I am uploading text data from a form. This data is either directly input into a textarea, or is a file stream originating from a .txt file, (or other basic text file (like off Mac or Unix - of course I don't necessarily know at present it's
0
1084
by: hristozov | last post by:
Hello group! The configuration: Windows, PHP 4.4.3, MySQL 5.0.24 I'm trying to upgrade PHP 4.4.3 to 5.1.6. I've installed and configured everything but there is a problem with my db applications on PHP - the UTF8 characters appear as "?". Apache, PHP and MySQL are fully (and correctly, I think) configured for UTF8 support and it worked on the old PHP, but now it just can't display the UTF8 characters (cyrillic in
8
2007
by: Daz | last post by:
Hi everyone. I was faced with the choice of whether my problem is indeed a PHP problem or a MySQL. I have decided it's a PHP problem as I don't experience the same problem when I execute the same query at the CLI. I am having trouble executing a large query through my PHP script. It takes about 7-11 seconds on average to execute, whereas the same query only takes 0.01 seconds to execute through the CLI.
1
5826
by: erikcw | last post by:
Hi, I'm trying to insert some data from an XML file into MySQL. However, while importing one of the files, I got this error: Traceback (most recent call last): File "wa.py", line 304, in ? main() File "wa.py", line 257, in main curHandler.walkData()
1
1455
by: panos100m | last post by:
Hi I am using DB_dataobjects and pear . I noticed that for some of my tables my insert statement doesnt work correclty .. Those tableas are tables that i changed recently (i removed the space and added "_" and now i removed the underscore also) So this is the output DataObjects_test: CONNECT: Checking for database database_ in options
12
9738
by: Punkis | last post by:
Hi all, I have a problem with my php and mysql project. I use an auctions software, named phpauction for my project. I import into my database with utf8 encodingm and I can see the greek letters inside the fields. The problem is that when i go to the site for the results, I get question marks instead of the greek characters. I have searched a lot, and i found that there is a solution by adding mysql_query("SET NAMES utf8") after...
0
8440
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, 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...
0
8352
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8863
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8549
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,...
0
8636
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 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...
1
6189
isladogs
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...
0
4192
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...
0
4358
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.