iwato Posted February 4, 2011 Share Posted February 4, 2011 Problem: When I run the following code in my current operating environment only two character encoding possibilities are returned -- namely, ASCII and UTF-8. Certainly my operating system is capable of processing many more. Similarly, when I enter JSIS as the $encoding parameter for the mb_internal_encoding() function, I am confronted with an error message telling me that JSIS does not exist.Question: How does one go about introducing the many more available encoding possibilities indicated at mb_detect_order: UTF-8, UTF-7, ASCII, EUC-JP,SJIS, eucJP-win, SJIS-win, JIS, ISO-2022-JP. foreach(mb_detect_order() as $encoding) { echo $encoding; echo '<br />';} Roddy Link to comment Share on other sites More sharing options...
justsomeguy Posted February 4, 2011 Share Posted February 4, 2011 Are you sure JSIS is what you're looking for, and not SJIS? Link to comment Share on other sites More sharing options...
iwato Posted February 4, 2011 Author Share Posted February 4, 2011 Are you sure JSIS is what you're looking for, and not SJIS? Reassessment:<?php mb_internal_encoding('SJIS'); mb_http_output('SJIS'); ob_start('mb_output_handler');?><?php $str = 'こんにちは';echo mb_detect_encoding($str); echo '<br />'; //UTF-8 $str = mb_convert_encoding($str, 'SJIS','UTF-8'); var_dump($str); echo '<br />'; var_dump(mb_detect_order());?> The above set of code renders the UTF-8 encoded Japanese assigned to $str appropriately, but when the mb_detect_order() function is called, SJIS does not appear in the list.Roddy Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.