A
A
Alex Smith2015-02-16 10:45:59
Character encoding
Alex Smith, 2015-02-16 10:45:59

How to change encoding in *.rtf file?

There is a *.rtf file, I open it in php as a string, I replace it with str_replace(); there are some values, after that the encoding of Russian letters is broken. The problem is that the file itself is in win 1251, and the values ​​\u200b\u200bthat I change to UTF-8. I tried to encode in notepad++ in UTF-8, but it didn't work. How to change/set encoding in rtf file? I found the line there:
{\rtf1\adeflang1025\ansi\ansicpg1251\uc1\adeff0\deff0\stshfdbch0\stshfloch1\stshfhich1\stshfbi1\deflang10
ansicpg1251 - this is the encoding, as I understand it, can I somehow change it to UTF-8?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2015-02-16
@sasnnick

if the file is in win 1251, then you need to write to it in win 1251.
iconv to help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question