Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.