php: using DomDocument whenever I try to write UTF-8 it writes the hexadecimal notation of it

前端 未结 6 966
清歌不尽
清歌不尽 2020-11-27 21:41

When I try to write UTF-8 Strings into an XML file using DomDocument it actually writes the hexadecimal notation of the string instead of the string itself.

for exam

6条回答
  •  萌比男神i
    2020-11-27 22:33

    When I created the DomDocument for writing, i added the following parameters:

    dom = new DOMDocument('1.0','utf-8');
    

    these parameters caused the UTF-8 string to be written as is.

提交回复
热议问题