dsdsdsdsd Posted June 4, 2010 Share Posted June 4, 2010 hello; I am using a webhosting company that will not allow me to make changes in their php config files; I am struggling to solve character encoding for special characters; ex: echo utf8_encode( "Č" ) // outputs C any thoughts? thanks, Shannon Link to comment https://forums.phpfreaks.com/topic/203877-echo-%C4%8D-outputs-c/ Share on other sites More sharing options...
gwolgamott Posted June 4, 2010 Share Posted June 4, 2010 Have you tried htmlspecialchars()? Link to comment https://forums.phpfreaks.com/topic/203877-echo-%C4%8D-outputs-c/#findComment-1067810 Share on other sites More sharing options...
dsdsdsdsd Posted June 4, 2010 Author Share Posted June 4, 2010 Gibby, thanks for responding; unfortunately html is not my final destination for the special characters; they are sent to flash; during that process flash uses "&varA=valA&varB=valB"; as a consequence I can't use &'s in my encoding; currently I am using string replacement scripts on both the php side and the flash side ... php: convert Č ==> ~C~ flash: convert ~C~ ==> Č which is ugly Link to comment https://forums.phpfreaks.com/topic/203877-echo-%C4%8D-outputs-c/#findComment-1067830 Share on other sites More sharing options...
gwolgamott Posted June 4, 2010 Share Posted June 4, 2010 Ugh I guess so, I don't know of any other encoding besides utf8 you are trying to use already off hand. Unless there is a way to escape the & character for use in string in flash (Not familiar at all with flash to know) then you may just be set on using the ugly replacement. But if it doesn't take a performance hit why care I guess. Wish I had a better answer. Maybe this will bump it & someone else will see that may know a worka round. Link to comment https://forums.phpfreaks.com/topic/203877-echo-%C4%8D-outputs-c/#findComment-1067863 Share on other sites More sharing options...
dsdsdsdsd Posted June 5, 2010 Author Share Posted June 5, 2010 this worked ... $db_l = mysql_connect ( $db_h, $db_u, $db_p ) ; $db_adb = mysql_select_db ( $db_n , $db_l ) ; mysql_set_charset( 'utf8' , $db_l ) ; Link to comment https://forums.phpfreaks.com/topic/203877-echo-%C4%8D-outputs-c/#findComment-1068176 Share on other sites More sharing options...
gwolgamott Posted June 7, 2010 Share Posted June 7, 2010 cool, wasn't aware of that function. That'll be useful for me in the future. Link to comment https://forums.phpfreaks.com/topic/203877-echo-%C4%8D-outputs-c/#findComment-1068981 Share on other sites More sharing options...
dsdsdsdsd Posted June 7, 2010 Author Share Posted June 7, 2010 unfortunately, mysql_set_charset is only available on php > 5.? ... therefore: function gf_set_charset ( $argn_charset, $argo_link ) { if ( function_exists( 'mysql_set_charset' ) === false) { mysql_query( 'SET NAMES "' . $argn_charset . '"' , $argo_link ) ; } else { mysql_set_charset( $argn_charset , $argo_link ) ; } ; } Link to comment https://forums.phpfreaks.com/topic/203877-echo-%C4%8D-outputs-c/#findComment-1069026 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.