dbx Posted January 20, 2009 Share Posted January 20, 2009 My pages use ISO-8859-1 I need to include a file in all my pages which uses UTF-8 to display Russian text. I get the "headers already sent" error when I try to repeat the character encoding line in the include file. How can I do it? Thanks. Link to comment https://forums.phpfreaks.com/topic/141592-including-files-that-uses-different-character-encoding/ Share on other sites More sharing options...
dbx Posted January 21, 2009 Author Share Posted January 21, 2009 anyone? Link to comment https://forums.phpfreaks.com/topic/141592-including-files-that-uses-different-character-encoding/#findComment-741901 Share on other sites More sharing options...
jkewlo Posted January 21, 2009 Share Posted January 21, 2009 put your code at the top of the page that you want to run if you have something that requires headers to be sent then it should be in that same area. I think I am correct but I may be wrong Link to comment https://forums.phpfreaks.com/topic/141592-including-files-that-uses-different-character-encoding/#findComment-741906 Share on other sites More sharing options...
haku Posted January 21, 2009 Share Posted January 21, 2009 You can use the mb_convert() function (its part of the mb_string library), but you will lose any russian characters that aren't part of the ISO-8859-1 charset. You are better off changing the encoding of the ISO-8859-1 files to be utf-8. Link to comment https://forums.phpfreaks.com/topic/141592-including-files-that-uses-different-character-encoding/#findComment-741958 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.