Skip to content

Commit

Permalink
Fixed encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Sominemo committed Jun 27, 2021
1 parent e622156 commit bb6ae62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/utils/sticker_url_to_id.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:convert';

import 'package:enough_convert/windows/windows1252.dart';
import 'package:enough_convert/enough_convert.dart';
import 'package:flutter/material.dart';
import 'package:vkget/vkget.dart';

Expand All @@ -11,7 +11,7 @@ Future<int?> stickerUrlToId(VKGet client, Uri url) async {
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36',
);
final html =
await const Windows1252Codec(allowInvalid: false).decodeStream(req);
await const Windows1251Codec(allowInvalid: false).decodeStream(req);
final res =
RegExp(r'Emoji.previewSticker\((\d+)\)').firstMatch(html)?.group(1);
print(res);
Expand All @@ -35,6 +35,6 @@ Future<Map<String, dynamic>> getStickerJson(
'with_suggested_recipients': '0',
});
final text =
await const Windows1252Codec(allowInvalid: false).decodeStream(req);
await const Windows1251Codec(allowInvalid: false).decodeStream(req);
return jsonDecode(text) as Map<String, dynamic>;
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.1.0+8
version: 1.1.0+9

environment:
sdk: ">=2.13.0 <3.0.0"
Expand Down

0 comments on commit bb6ae62

Please sign in to comment.