Jump to content

Character encoding and rewrite?


msaspence

Recommended Posts

im having a real problem with character encoding and php

i aware that php has some problems with character encoding but i dont really understand them

whats got me even more stumped is that when i was developing the same thing on my pc i never had this problem im now on a mac

whats more the problem only seems to happen when using the rewrite rule in the htaccess?

 

basically if i have an file index.html and it is

<?php

      echo "£";

?>

 

it echos a £ sign fine

 

if however i use an htaccess file to redirect any request to another file lets say invoke.html and it has the same thing it outputs £

 

i know for this example i should just echo £

but this isnt exactly what im trying to do

this is just the simpliest example of the problem

what im actually doing is fopen fread a file then using strpos to find any £ symbols

 

the £ symbols in the file are just £ symbols

if i echo the read file contents they output as just £ symbols

 

however if i put "£" in as the needle for strpos it goes in as £ and therefore doesnt find it in the haystack

 

any ideas on why this is

or how i might fix it would be really appreciated

Link to comment
https://forums.phpfreaks.com/topic/76903-character-encoding-and-rewrite/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.