GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - BaseMax/DecodeQueryStringC: A tiny library for decode value of the query string using c with utf8 support and html entities.

BranchesTags
Open more actions menu

Latest commit

 

History

55 Commits
55 Commits

Folders and files

NameName
Last commit message
Last commit date
example
example
 
 
source
source
 
 
test
test
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

Decode Query String Using C

A tiny library for decode value of the query string using c with utf8 support and html entities.

Using

decodeUrl(destination,source);
decodeHtmlEntities(destination,source);

Functions

void decodeUrl(char *destination,const char *source);
size_t decodeHtmlEntities(char *destination,const char *source);
// char *urlDecode(const char *str);
// static inline char toUpper(char c);
static int parseEntity(const char *current,char **to,const char **from);
static size_t putUtf8Char(unsigned long value,char *buffer);
static const char *getNamedEntity(const char *name);
static int stringCompare(const void *key,const void *value);

Global Variable

// const char asciiHex[23] = {...};
static const char *const NamedEntities[][2] = {...};

Includes

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>

Example I/O

Input: %D8%B3%D9%84%D8%A7%D9%85
Output: سلام

Input: HELLO%2C+%26%231587%3B%26%231604%3B%26%231575%3B%26%231605%3B+%2C+%26%231777%3B%26%231778%3B%26%231779%3B
Output: HELLO, سلام , ۱۲۳

Compile Example

$ git clone https://github.com/BaseMax/DecodeQueryStringC
$ cd DecodeQueryStringC/
$ cd example/
$ gcc main.c ../source/decodequery.c -o main
$ ./main

Copyright

Many resources have been used to implement this library. (Eg NamedEntities, ...)

Also, some of the code has been follow from certain libraries.

So, if you use this complete library, keep the author's name.

In addition, parts of the code have also been optimized. If you have any suggestions for improvement or correction, you can submit.

Thank You.

About

A tiny library for decode value of the query string using c with utf8 support and html entities.

Topics

cdecodedecode-formdecode-stringsdecode-urlsdecoderdecodershtmlentitiesparserparser-libraryparser-pluginparsersquerystringquerystringsurl-parserurldecode

Resources

Readme
GPL-3.0 license
Activity

Stars

49 stars

Watchers

3 watching

Forks

9 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.