unicode_encode
unicode 文字列を任意のエンコーディングに変換する
&reftitle.description;
stringunicode_encode
unicodeinput
stringencoding
interrmode
unicode 文字列を受け取り、それを指定したエンコーディング
encoding の文字列に変換します。
&reftitle.parameters;
input
エンコードする unicode 文字列。
encoding
input の新しいエンコーディング。
errmode
変換エラーモード。このパラメータで、
コンバータが文字を変換できなかったときの動作を指定します。
使用できるモードについては unicode_set_error_mode
を参照ください。このパラメータを省略した場合は、グローバルなエラーモードを使用します。
&reftitle.returnvalues;
成功した場合に文字列、&return.falseforfailure;。
&reftitle.errors;
指定したエンコーディングの変換器が作成できない場合に
E_WARNING レベルのエラーが発生します。
&reftitle.examples;
unicode_encode の例
注意: 出力は、エンティティではなく文字になります。
]]>
&example.outputs.similar;
&reftitle.notes;
&warn.experimental.func;
&reftitle.seealso;
unicode_set_error_mode
unicode_decode