All Projects → timakin → gonvert

timakin / gonvert

Licence: other
Golang character encoding converter with an automatic code-estimation.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to gonvert

Jave2
The JAVE (Java Audio Video Encoder) library is Java wrapper on the ffmpeg project
Stars: ✭ 570 (+2275%)
Mutual labels:  converter, encoder
sms
A Go library for encoding and decoding SMSs
Stars: ✭ 37 (+54.17%)
Mutual labels:  encoding, encoder
Axiom
An FFmpeg GUI for Windows
Stars: ✭ 560 (+2233.33%)
Mutual labels:  converter, encoder
VIDEOconvertor
A stable and Fast telegram video convertor bot which can encode into different libs and resolution, compress videos, convert video into audio and other video formats, rename with thumbnail support, generate screenshot and trim videos.
Stars: ✭ 180 (+650%)
Mutual labels:  converter, encoder
AnimatedGif
📼 A high performance .NET library for reading and creating animated GIFs
Stars: ✭ 106 (+341.67%)
Mutual labels:  encoding, encoder
ffcvt
ffmpeg convert wrapper tool
Stars: ✭ 32 (+33.33%)
Mutual labels:  encoding, encoder
Wx Voice
Convert audio files between Tencent apps (Weixin / Wechat, QQ) and Silk codec with other general formats such as MP3 and M4A
Stars: ✭ 93 (+287.5%)
Mutual labels:  converter, encoder
Qs
Go module for encoding structs into URL query parameters
Stars: ✭ 55 (+129.17%)
Mutual labels:  encoding, encoder
gb-convert
Gameboy tile conversion and map editor tool
Stars: ✭ 26 (+8.33%)
Mutual labels:  encoding, converter
urdu-characters
📄 Complete collection of Urdu language characters & unicode code points.
Stars: ✭ 24 (+0%)
Mutual labels:  encoding, character
Minih264
Minimalistic H264/SVC encoder single header library
Stars: ✭ 390 (+1525%)
Mutual labels:  encoding, encoder
BatchEncoder
BatchEncoder is an audio files conversion software.
Stars: ✭ 145 (+504.17%)
Mutual labels:  converter, encoder
caffe weight converter
Caffe-to-Keras weight converter. Can also export weights as Numpy arrays for further processing.
Stars: ✭ 68 (+183.33%)
Mutual labels:  converter
ics-to-json
📅 Convert ICS calendars (eg. Google Calendar) to an opinionated JSON format.
Stars: ✭ 36 (+50%)
Mutual labels:  converter
js-church-encoding
Church Encoding Implementation in JavaScript
Stars: ✭ 33 (+37.5%)
Mutual labels:  encoding
bank2ynab
Easily convert and import your bank's statements into YNAB. This project consolidates other conversion efforts into one universal tool.
Stars: ✭ 197 (+720.83%)
Mutual labels:  converter
gocnab
CNAB (Un)Marshaler
Stars: ✭ 20 (-16.67%)
Mutual labels:  encoder
System.Configuration.Abstractions
Injectable, mockable, extensible, configuration for .NET
Stars: ✭ 42 (+75%)
Mutual labels:  converter
badchars
Bad char generator to instruct encoders such as shikata-ga-nai to transform those to other chars.
Stars: ✭ 178 (+641.67%)
Mutual labels:  encoder
video-quality-metrics
Test specified presets/CRF values for the x264 or x265 encoder. Compares VMAF/SSIM/PSNR numerically & via graphs.
Stars: ✭ 87 (+262.5%)
Mutual labels:  encoder

Gonvert

Simple character-encoding converter with an automatic character-code detection in Golang. You can convert without a declaration of a previous encoding.

Build Status Coverage Status

Install

go get github.com/timakin/gonvert

Current Support

  • Shift_JIS <-> UTF8
  • Shift_JIS <-> EUC-JP
  • Shift_JIS <-> GBK
  • EUC-JP <-> UTF8
  • EUC-JP <-> GBK
  • GBK <-> UTF8
  • UTF8 <-> UTF16

You can specify the character code to encode/decode with gonvert constatants.

Prepared const character-code is following.

const (
	UTF8 CharCode = iota
	SJIS
	EUCJP
	GBK
	UTF16BE
	UTF16LE
)

Usage

You can call the converter with 2 or 3 arguements.

If you set 2 variables, gonvert will estimate the code automatically.

But if you already know the code of strings, you should set the third arguements, without an estimation.

package main

import (
    "github.com/timakin/gonvert"
    "fmt"
)
func main() {
    // ------------ Estimation case ------------

    // Input a Shift_JIS encoded string
    sjisStr := "\x8c\x8e\x93\xfa\x82\xcd\x95\x53\x91\xe3\x82\xcc\x89\xdf\x8b" +
               "\x71\x82\xc9\x82\xb5\x82\xc4\x81\x41\x8d\x73\x82\xa9\x82\xd3" +
               "\x94\x4e\x82\xe0\x96\x94\x97\xb7\x90\x6c\x96\xe7\x81\x42"
    converter := gonvert.New(sjisStr, gonvert.UTF8)
    result, err := converter.Convert()
    if err != nil {
        panic("Failed to convert!")
    }
    // This will print out the utf-8 encoded string: "月日は百代の過客にして、行かふ年も又旅人也。"
    fmt.Print(result)

    // -----------------------------------------

    // ------------ Specified-code case ------------

    sjisStr := "\x8c\x8e\x93\xfa\x82\xcd\x95\x53\x91\xe3\x82\xcc\x89\xdf\x8b" +
               "\x71\x82\xc9\x82\xb5\x82\xc4\x81\x41\x8d\x73\x82\xa9\x82\xd3" +
               "\x94\x4e\x82\xe0\x96\x94\x97\xb7\x90\x6c\x96\xe7\x81\x42"

    // Should send `before` character code if you already know, because an estimation like above may become incorrect.
    converter := gonvert.New(sjisStr, gonvert.UTF8, gonvert.SJIS)
    result, err := converter.Convert()
    if err != nil {
        panic("Failed to convert!")
    }
    fmt.Print(result)

    // -----------------------------------------
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].