• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Encoding problems and FPDF

I have a problem with strange characters appearing at the beginning of the page. I searched this forum and found similar cases indicating that the incorrect encoding is the problem. However, the typical "save your files as UTF without BOM" solution doesn't work for me, because I am using FPDF library and it doesn't support UTF, so I need to save the controller using latin1 encoding. I would like to solve this issue quickly, so e.g. changing the library to generate PDFs is not a good option for me. My web application is not multilingual, so I am fine with latin1, although UTF is recommended for CI applications.

I see two potential solutions:
1. Convert all CI files to latin1 and define this encoding in the config file.
The question is, how can I convert all the files in batch more and make sure BOM is removed? Editing each file separately in Notepad++ is not convenient Wink

2. Encode the application as UTF, but save the PDF generation function in a separate latin1 file.
Here my doubts are bigger, since I am not sure if this will work and how to call a function in a separate file passing some data?

Maybe you know some other option I overlooked?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.