printing - Printer function in PHP cannot print Chinese character (UTF-8) -


I use the printer function to print some data in the text file (.txt), which includes Chinese and English words They can display correctly in both webpages, while printing, the English word looks good but the Chinese word does not show the correct output. Any tips to overcome this? Please help me out my coding below.

  & lt ;? Php $ print = file_get_contents ("print.txt"); $ Printer = "XP-80"; // Printer name resonance print $; If ($ ph = printer_open ($ printer)) {printer_set_option ($ ph, PRINTER_MODE, "RAW"); Printer_write ($ pH, $ print); Print_close ($ pH); }? & Gt; 

There are some things that I can think of as a cause of problem: / P>

  • The font you select is not compatible with UTF-8. There is also a note about
  • printer_set_option () . Since 2009, it is not certain that it is still valid.

    After you comment, edit:

    with this example

      $ font = printer_create_font ("Aerial", 148, 76, PRINTER_FW_MEDIUM, wrong, false, false, -50); Printer_select_font ($ ph, $ font);    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -