All Projects → best-flutter → gbk2utf8

best-flutter / gbk2utf8

Licence: MIT license
A flutter package to convert gbk to utf-8

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to gbk2utf8

flutter ume
UME is an in-app debug kits platform for Flutter. Produced by Flutter Infra team of ByteDance
Stars: ✭ 1,792 (+4380%)
Mutual labels:  flutter-plugin
flutter contest
Flutter project submitted on Flutter contest
Stars: ✭ 14 (-65%)
Mutual labels:  flutter-plugin
stop watch timer
This is Stop Watch Timer for flutter plugin.🏃‍♂️
Stars: ✭ 76 (+90%)
Mutual labels:  flutter-plugin
multibase
multi base encoding/decoding utility
Stars: ✭ 15 (-62.5%)
Mutual labels:  encoding
fastify-accepts
Add accepts parser to fastify
Stars: ✭ 51 (+27.5%)
Mutual labels:  encoding
nearby connections
Flutter plugin (android) for sharing bytes and files Offline, (Based on the android Nearby Connections API)
Stars: ✭ 64 (+60%)
Mutual labels:  flutter-plugin
js-multibase
JavaScript implementation of the multibase specification
Stars: ✭ 22 (-45%)
Mutual labels:  encoding
AMVtool
Qt GUI for FFmpeg designed for video editors.
Stars: ✭ 28 (-30%)
Mutual labels:  encoding
material-about
An about screen to use in your Mobile apps.
Stars: ✭ 37 (-7.5%)
Mutual labels:  flutter-plugin
morton-nd
A header-only compile-time Morton encoding / decoding library for N dimensions.
Stars: ✭ 78 (+95%)
Mutual labels:  encoding
Flutter-Mobile-Number-Plugin
Flutter Plugin to get the mobile number
Stars: ✭ 22 (-45%)
Mutual labels:  flutter-plugin
youtube-downloader-python
You can download the YouTube video for free and convert it to any extension you want.
Stars: ✭ 20 (-50%)
Mutual labels:  encoding
barcode.flutter
barcode generate library for Flutter
Stars: ✭ 58 (+45%)
Mutual labels:  flutter-plugin
flutter-scankit
Flutter QR code scanning
Stars: ✭ 107 (+167.5%)
Mutual labels:  flutter-plugin
getx-snippets-intelliJ
An extension to accelerate the process of developing applications with flutter, aimed at everyone using the GetX package.
Stars: ✭ 52 (+30%)
Mutual labels:  flutter-plugin
scalable image
A widget that shows an image which can be scaled and dragged using gestures.
Stars: ✭ 15 (-62.5%)
Mutual labels:  flutter-plugin
flutter easyloading
✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web
Stars: ✭ 1,021 (+2452.5%)
Mutual labels:  flutter-plugin
BencodeNET
.NET library for encoding/decoding bencode and reading/writing torrent files
Stars: ✭ 133 (+232.5%)
Mutual labels:  encoding
EntityEmbedding-Working Example
This repository contains a notebook demonstrating a practical implementation of the so-called Entity Embedding for Encoding Categorical Features for Training a Neural Network.
Stars: ✭ 75 (+87.5%)
Mutual labels:  encoding
gonvert
Golang character encoding converter with an automatic code-estimation.
Stars: ✭ 24 (-40%)
Mutual labels:  encoding

gbk2utf8

A flutter package to convert gbk to utf-8

目的

现在这个版本官方的http还不能支持中文gbk的解析,这个项目就是为了解决这个问题

目前这个库已经成熟,严格来说,这个库的作用不是gbk和utf8的相互转换,而是服务器的gbk二进制数据流和dart的String之间相互转换,类似flutter原有的utf8编码调用,即为gbk.encode和gbk.decode这两个方法进行转化。 如果还有不懂的地方,可以入群854192563讨论.

使用方法

增加依赖


gbk2utf8: ^1.0.1

String转gbk流用以上传服务器

gbk.encode("需要转gbk的中文");

注意转化后的结果是List,中文编码的二进制流,在上传表单的时候需要注意编码格式。

gbk流转String

gbk.decode(gbk二进制流,一般是http的response);

例子:解析中文html

编写代码

 void download() async {
    try {
      http.Response response =
          await http.get("http://www.ysts8.com/index_hot.html");
      String data = gbk.decode(response.bodyBytes);
      setState(() {
        _text = data;
      });
    } catch (e) {
      setState(() {
        _text = "网络异常,请检查";
      });
    }
  }

完整代码在

这里

效果:

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].