Menu

Problem with characters like & or

Help
2005-07-06
2013-04-17
  • Nobody/Anonymous

    Hi

    i have a problem with some characters like & or .
    If i use the character "&" i cant get an sxw document and cant convert it to doc-format.
    I think phpdocwriter use UTF-8 and so i think it must be work.
    I hope somebody has an idea to help me!

    Thanks!

     
    • Jose Manuel Sanchez Rivero

      Hi,

      This is a known problem with the last released version, maybe you can try to replace these characters before calling to "write()" using something like this:

      $sxw->write(htmlspecialchars($string, ENT_QUOTES));

      Next version of the library will replace these chars automatically.

      Regards.

       
    • Nobody/Anonymous

      Ok, but there is the Problem that i cant replace the characters, because i need these to generate a letter or a calculation.
      Have you an idea why it doesnt work.

       
    • Nobody/Anonymous

      sorry!!! I didnt understand you correctly! I try it with htmlspecialchars(...) and it works! Thanks for your help.
      You had said that in the next version it will work automatically. Where would change it, in function Write()?
      With htmlspecialchars(..)?

       
    • Jose Manuel Sanchez Rivero

      Well, htmlspecialchars() could be a posibility, but it should be added wherever the user inputs any "data" to the document: write function, metadata functions, name of styles, etc.

      Anyway, the version I'm currently working on depends on the DOM extension (PHP5), so this will be transparent also for the library (the extension do the conversion of the characters).

      Regards.

       
    • Nobody/Anonymous

      Hi,

      i have the same problem with .
      When i generate the document, i get a €€€square wheras a ...I try htmlspecialchars but it doesnt work.
      Please help me!

       
    • Nobody/Anonymous

      sorry i get a square only wheras a , i try also to change the encoding but it doesn't work too...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.