How can I decode HTML entities in C++? -


how can decode html entities in c++?

for example:

html: "music" & "video"

decoded: "music" & "video"

thanks.

if you're comfortable using c-strings, might interested in my answer similar question.


there's no need compile code c++: compile entities.c -std=c99 , link object file c++ code, eg if have follwing example program foo.cpp

#include <iostream>  extern "c" size_t decode_html_entities_utf8(char *dest, const char *src);  int main() {     char line[100];     std::cout << "enter encoded line: ";     std::cin.getline(line, sizeof line);     decode_html_entities_utf8(line, 0);     std::cout << line;     return 0; } 

use

g++ -o foo foo.cpp entities.o 

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -