急!!! 转换成UTF8后出现"未结束的字符串常量".
将PHP文件GBK转换成UTF8后出现 "未结束的字符串常量 "和 "缺少 '} ' "错误提示。
程序是调用tinyMCE编辑器,不懂JSP啊,请大师帮忙!
tinyMCE程序文件(tiny_mce.js等)都是以UTF8编码的啊。
echo ' <script language= "javascript " type= "text/javascript " src= "./tiny_mce/tiny_mce.js "> </script> ';
}
echo ' <script language= "javascript " type= "text/javascript ">
tinyMCE.init({
cleanup : true,
auto_cleanup_word : true,
language: "en ",
verify_html : false,
relative_urls : true,
document_base_url : " ' . $sdurl . ' ",
remove_script_host : false,
mode : "specific_textareas ",
textarea_trigger : "wysiwyg ",
theme : "advanced ",
theme_advanced_layout_manager : "SimpleLayout ",
modules : "advhr,advimage,advlink,contextmenu,flash,imagemanager,insertdatetime,print,searchreplace,smilies,style,table ",
theme_advanced_buttons1 : "code,print,separator,formatselect,fontselect,fontsizeselect,separator,forecolor,backcolor,bold,italic,underline,styleprops,removeformat ",
theme_advanced_buttons2 : "justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,search,replace,separator,inserttime,insertdate,separator,charmap,smilies,flash,advhr,separator,link,unlink,anchor,separator,image,imagemanager ",
theme_advanced_buttons3 : "newdocument,separator,undo,redo,separator,cut,copy,paste,separator,cleanup,separator,tablecontrols,visualaid ",
theme_advanced_toolbar_location : "top ",
theme_advanced_toolbar_align : "left ",
theme_advanced_path_location : "bottom ",
module_insertdate_dateFormat : "%Y-%m-%d ",
module_insertdate_timeFormat : "%H:%M:%S ",
extended_valid_elements : "iframe[frameborder|align|height|longdesc|marginheight|mar ginwidth|name|scrolling|src|width],a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|style],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style] "
});
</script> ';
[解决办法]
问题应该是某些汉字在UTF8中不能正确识别.
你是不是直接改的文件字符集,这样做是不行的,要用一些编辑器的另存为来修改字符集.
[解决办法]
echo ' <script language= "javascript " type= "text/javascript " src= "./tiny_mce/tiny_mce.js "> </script> ';
php的吧
只知道在javascript中,遇到 </script> 就结束了
<SCRIPT>
alert( ' <script language= "javascript " type= "text/javascript " src= "./tiny_mce/tiny_mce.js "> </script> ');
</SCRIPT>
以上会出错,改成以下就好了:
<SCRIPT>
alert( ' <script language= "javascript " type= "text/javascript " src= "./tiny_mce/tiny_mce.js "> </scr ' + 'ipt> ');
</SCRIPT>
您试试?