├── .github
└── workflows
│ └── main.yml
├── .gitignore
├── Makefile
├── README.md
├── flutter_charset_detector
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── example
│ ├── .gitignore
│ ├── .metadata
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── android
│ │ ├── .gitignore
│ │ ├── app
│ │ │ ├── build.gradle
│ │ │ └── src
│ │ │ │ ├── debug
│ │ │ │ └── AndroidManifest.xml
│ │ │ │ ├── main
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ ├── kotlin
│ │ │ │ │ └── com
│ │ │ │ │ │ └── madlonkay
│ │ │ │ │ │ └── flutter_charset_detector_example
│ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── res
│ │ │ │ │ ├── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ └── values
│ │ │ │ │ └── styles.xml
│ │ │ │ └── profile
│ │ │ │ └── AndroidManifest.xml
│ │ ├── build.gradle
│ │ ├── gradle.properties
│ │ ├── gradle
│ │ │ └── wrapper
│ │ │ │ └── gradle-wrapper.properties
│ │ └── settings.gradle
│ ├── assets
│ │ └── sjis-example.txt
│ ├── ios
│ │ ├── .gitignore
│ │ ├── Flutter
│ │ │ ├── AppFrameworkInfo.plist
│ │ │ ├── Debug.xcconfig
│ │ │ └── Release.xcconfig
│ │ ├── Podfile
│ │ ├── Podfile.lock
│ │ ├── Runner.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ │ └── WorkspaceSettings.xcsettings
│ │ │ └── xcshareddata
│ │ │ │ └── xcschemes
│ │ │ │ └── Runner.xcscheme
│ │ ├── Runner.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ └── Runner
│ │ │ ├── AppDelegate.swift
│ │ │ ├── Assets.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ │ └── LaunchImage.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ └── README.md
│ │ │ ├── Base.lproj
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── Main.storyboard
│ │ │ ├── Info.plist
│ │ │ └── Runner-Bridging-Header.h
│ ├── lib
│ │ └── main.dart
│ ├── macos
│ │ ├── .gitignore
│ │ ├── Flutter
│ │ │ ├── Flutter-Debug.xcconfig
│ │ │ ├── Flutter-Release.xcconfig
│ │ │ └── GeneratedPluginRegistrant.swift
│ │ ├── Podfile
│ │ ├── Podfile.lock
│ │ ├── Runner.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace
│ │ │ │ └── xcshareddata
│ │ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ └── xcshareddata
│ │ │ │ └── xcschemes
│ │ │ │ └── Runner.xcscheme
│ │ ├── Runner.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ ├── Runner
│ │ │ ├── AppDelegate.swift
│ │ │ ├── Assets.xcassets
│ │ │ │ └── AppIcon.appiconset
│ │ │ │ │ ├── Contents.json
│ │ │ │ │ ├── app_icon_1024.png
│ │ │ │ │ ├── app_icon_128.png
│ │ │ │ │ ├── app_icon_16.png
│ │ │ │ │ ├── app_icon_256.png
│ │ │ │ │ ├── app_icon_32.png
│ │ │ │ │ ├── app_icon_512.png
│ │ │ │ │ └── app_icon_64.png
│ │ │ ├── Base.lproj
│ │ │ │ └── MainMenu.xib
│ │ │ ├── Configs
│ │ │ │ ├── AppInfo.xcconfig
│ │ │ │ ├── Debug.xcconfig
│ │ │ │ ├── Release.xcconfig
│ │ │ │ └── Warnings.xcconfig
│ │ │ ├── DebugProfile.entitlements
│ │ │ ├── Info.plist
│ │ │ ├── MainFlutterWindow.swift
│ │ │ └── Release.entitlements
│ │ └── RunnerTests
│ │ │ └── RunnerTests.swift
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ ├── test
│ │ └── widget_test.dart
│ └── web
│ │ ├── favicon.png
│ │ ├── icons
│ │ ├── Icon-192.png
│ │ ├── Icon-512.png
│ │ ├── Icon-maskable-192.png
│ │ └── Icon-maskable-512.png
│ │ ├── index.html
│ │ └── manifest.json
├── lib
│ └── flutter_charset_detector.dart
├── pubspec.lock
├── pubspec.yaml
└── test
│ └── flutter_charset_detector_test.dart
├── flutter_charset_detector_android
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── android
│ ├── .gitignore
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── kotlin
│ │ └── com
│ │ └── madlonkay
│ │ └── flutter_charset_detector
│ │ └── FlutterCharsetDetectorPlugin.kt
├── lib
│ └── flutter_charset_detector_android.dart
├── pubspec.lock
└── pubspec.yaml
├── flutter_charset_detector_darwin
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── darwin
│ ├── .gitignore
│ ├── Assets
│ │ └── .gitkeep
│ ├── Classes
│ │ ├── FlutterCharsetDetectorPlugin.h
│ │ ├── FlutterCharsetDetectorPlugin.m
│ │ └── SwiftFlutterCharsetDetectorPlugin.swift
│ └── flutter_charset_detector_darwin.podspec
├── lib
│ └── flutter_charset_detector_darwin.dart
├── pubspec.lock
└── pubspec.yaml
├── flutter_charset_detector_platform_interface
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── lib
│ ├── decoding_result.dart
│ ├── flutter_charset_detector_platform_interface.dart
│ └── src
│ │ └── method_channel_charset_detector.dart
├── pubspec.lock
└── pubspec.yaml
└── flutter_charset_detector_web
├── .gitignore
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── example
├── .gitignore
├── README.md
├── analysis_options.yaml
├── lib
│ └── main.dart
├── pubspec.lock
├── pubspec.yaml
└── web
│ ├── favicon.png
│ ├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
│ ├── index.html
│ └── manifest.json
├── lib
├── assets
│ └── web
│ │ └── jschardet.min.js
├── flutter_charset_detector_web.dart
├── js_charset_detector.dart
└── js_textdecoder.dart
└── pubspec.yaml
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: Flutter CI
2 |
3 | on:
4 | push:
5 | branches: [ master ]
6 | pull_request:
7 | branches: [ master ]
8 |
9 | jobs:
10 | build:
11 |
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - uses: actions/checkout@v2
16 | - uses: subosito/flutter-action@v1
17 | with:
18 | channel: 'beta'
19 | - name: Install dependencies
20 | run: make deps
21 | - name: Analyze
22 | run: make analyze
23 | - name: Run tests
24 | run: make test
25 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
9 | .idea
10 |
11 | *~
12 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | do_all_projects = for p in flutter_charset_detector*; do (cd $$p && $(1)); done
2 | jschardet_version := v3.1.0
3 | jschardet_url := https://raw.githubusercontent.com/aadsm/jschardet/$(jschardet_version)/dist/jschardet.min.js
4 | jschardet := flutter_charset_detector_web/lib/assets/web/jschardet.min.js
5 |
6 | .PHONY: deps
7 | deps: ## Fetch deps in all subprojects
8 | $(call do_all_projects,flutter pub get $(args))
9 |
10 | .PHONY: outdated
11 | outdated: ## Check outdated deps in all subprojects
12 | $(call do_all_projects,flutter pub outdated $(args))
13 |
14 | .PHONY: upgrade
15 | upgrade: ## Upgrade deps in all subprojects
16 | $(call do_all_projects,flutter pub upgrade $(args))
17 |
18 | .PHONY: analyze
19 | analyze: ## Run analysis in all subprojects
20 | flutter analyze flutter_charset_detector*
21 |
22 | .PHONY: test
23 | test: ## Run tests in all subprojects
24 | for t in flutter_charset_detector*/test flutter_charset_detector*/*/test; do (cd $$t/.. && flutter test); done
25 |
26 | .PHONY: assets
27 | assets: ## Download vendor assets
28 | assets: $(jschardet)
29 |
30 | $(jschardet):
31 | mkdir -p $(@D)
32 | curl -o $(@) $(jschardet_url)
33 |
34 | .PHONY: clobber
35 | clobber: ## Delete all vendor files
36 | clobber:
37 | rm -rf $(jschardet)
38 |
39 | .PHONY: help
40 | help: ## Show this help text
41 | $(info usage: make [target])
42 | $(info )
43 | $(info Available targets:)
44 | @awk -F ':.*?## *' '/^[^\t].+?:.*?##/ \
45 | {printf " %-24s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | flutter_charset_detector/README.md
--------------------------------------------------------------------------------
/flutter_charset_detector/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 81a45ec2e5f80fa71d5135f1702ce540558b416d
8 | channel: beta
9 |
10 | project_type: plugin
11 |
--------------------------------------------------------------------------------
/flutter_charset_detector/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 5.0.0
2 |
3 | * Web implementation now requires Dart 3.3+
4 |
5 | ## 4.0.0
6 |
7 | * Android implementation now requires SDK 21
8 |
9 | ## 3.1.0
10 |
11 | * Add `detect` method to obtain the detected charset without decoding the
12 | supplied bytes
13 |
14 | ## 3.0.0
15 |
16 | * Add macOS implementation
17 | * iOS implementation now requires iOS 11+
18 |
19 | ## 2.1.0
20 |
21 | * Add web implementation
22 |
23 | ## 2.0.0
24 |
25 | * Drop older Android Gradle Plugin support
26 |
27 | ## 1.0.2
28 |
29 | * Migrate to federated architecture
30 |
31 | ## 1.0.1
32 |
33 | * Fix incompatibility with Kotlin <1.3.70
34 | ([#1](https://github.com/amake/flutter_charset_detector/issues/1))
35 |
36 | ## 1.0.0
37 |
38 | * Migrate to non-nullable by default
39 |
40 | ## 0.3.0
41 |
42 | * Update Android detection library
43 | * juniversalchardet 2.4.0
44 |
45 | ## 0.2.0
46 |
47 | * Update iOS detection library
48 | * UniversalDetector2 2.0.0 (uchardet 0.0.7)
49 |
50 | ## 0.1.1
51 |
52 | * Fleshed out package description
53 |
54 | ## 0.1.0
55 |
56 | * Rename `DecodingResult.encoding` to `.charset`
57 | * `DecodingResult.fromJson` constructor is now private
58 | * Document public APIs
59 |
60 | ## 0.0.1
61 |
62 | * Initial release
63 | * juniversalchardet 2.3.2
64 | * UniversalDetector 1.4.0 (uchardet pre-0.0.2 (84e292))
65 |
--------------------------------------------------------------------------------
/flutter_charset_detector/README.md:
--------------------------------------------------------------------------------
1 | # flutter_charset_detector
2 |
3 | Automatically detect and decode the charset (character encoding) of text bytes.
4 |
5 |
6 |
7 | _The example app; [details](./example/README.md)_
8 |
9 | This plugin uses native libraries derived from the universal charset detection
10 | libraries created by Mozilla.
11 |
12 | - iOS, macOS:
13 | [UniversalDetector2](https://cocoapods.org/pods/UniversalDetector2), a thin
14 | wrapper around [uchardet](https://www.freedesktop.org/wiki/Software/uchardet/)
15 | - Android:
16 | [juniversalchardet](https://github.com/albfernandez/juniversalchardet), a Java
17 | implementation of universalchardet
18 | - Web: [jschardet](https://github.com/aadsm/jschardet), a JavaScript port of the
19 | Python [chardet](https://github.com/chardet/chardet)
20 |
21 | ## Supported platforms
22 |
23 | - Android 4.1 (SDK 16) and higher
24 | - iOS 11 and higher
25 | - macOS 10.14 and higher
26 | - Web (requires [TextDecoder](https://caniuse.com/textencoder) support)
27 |
28 | ## Supported charsets
29 |
30 | The detectable charsets differ by platform according to the capabilities of the
31 | underlying library; for specifics see:
32 |
33 | - [iOS, macOS](https://gitlab.freedesktop.org/uchardet/uchardet/-/blob/v0.0.8/README.md#supported-languagesencodings)
34 | - [Android](https://github.com/albfernandez/juniversalchardet/blob/v2.5.0/README.md#encodings-that-can-be-detected)
35 | - [Web](https://github.com/aadsm/jschardet/blob/v3.1.0/README.md#supported-charsets)
36 |
37 | ## Setup
38 |
39 | - [Web](https://github.com/amake/flutter_charset_detector/tree/master/flutter_charset_detector_web#usage)
40 | - Others: no special setup required
41 |
42 | ## Usage
43 |
44 | ```dart
45 | import 'package:flutter_charset_detector/flutter_charset_detector.dart';
46 |
47 | Uint8List bytes = getBytes(); // bytes with unknown encoding
48 | DecodingResult result = CharsetDetector.autoDecode(bytes);
49 | print(result.charset); // => e.g. 'SHIFT_JIS'
50 | print(result.string); // => e.g. '日本語'
51 | ```
52 |
53 | ## See also
54 |
55 | - [charset_converter](https://pub.dev/packages/charset_converter) if you already
56 | know the name of the charset you want to encode/decode
57 |
--------------------------------------------------------------------------------
/flutter_charset_detector/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
3 | analyzer:
4 | language:
5 | strict-casts: true
6 | strict-inference: true
7 | strict-raw-types: true
8 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: "1751123cde4ffad08ae27bdee4f8ddebd033fe76"
8 | channel: "beta"
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 1751123cde4ffad08ae27bdee4f8ddebd033fe76
17 | base_revision: 1751123cde4ffad08ae27bdee4f8ddebd033fe76
18 | - platform: macos
19 | create_revision: 1751123cde4ffad08ae27bdee4f8ddebd033fe76
20 | base_revision: 1751123cde4ffad08ae27bdee4f8ddebd033fe76
21 |
22 | # User provided section
23 |
24 | # List of Local paths (relative to this file) that should be
25 | # ignored by the migrate tool.
26 | #
27 | # Files that are not part of the templates will be ignored by default.
28 | unmanaged_files:
29 | - 'lib/main.dart'
30 | - 'ios/Runner.xcodeproj/project.pbxproj'
31 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/README.md:
--------------------------------------------------------------------------------
1 | # flutter_charset_detector_example
2 |
3 | Demonstrates how to use the flutter_charset_detector plugin.
4 |
5 |
6 |
7 | The app loads an asset file encoded in
8 | [Shift-JIS](https://en.wikipedia.org/wiki/Shift_JIS) in three ways from top to
9 | bottom:
10 |
11 | 1. Using the default charset: Flutter's various load mechanisms by default
12 | assume UTF-8, and fail if there are unrepresentable characters
13 | 2. Using UTF-8 with "allow malformed": Interpret the bytes as UTF-8 and replace
14 | any unrepresentable characters with U+FFFD (�)
15 | 3. With auto-detection through `CharsetDetector.autoDecode`: the result includes
16 | the detected charset and the decoded string
17 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
3 | linter:
4 | rules:
5 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "com.android.application"
3 | id "kotlin-android"
4 | id "dev.flutter.flutter-gradle-plugin"
5 | }
6 |
7 | def localProperties = new Properties()
8 | def localPropertiesFile = rootProject.file('local.properties')
9 | if (localPropertiesFile.exists()) {
10 | localPropertiesFile.withReader('UTF-8') { reader ->
11 | localProperties.load(reader)
12 | }
13 | }
14 |
15 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16 | if (flutterVersionCode == null) {
17 | flutterVersionCode = '1'
18 | }
19 |
20 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
21 | if (flutterVersionName == null) {
22 | flutterVersionName = '1.0'
23 | }
24 |
25 | android {
26 | namespace 'com.madlonkay.flutter_charset_detector_example'
27 | compileSdk flutter.compileSdkVersion
28 |
29 | sourceSets {
30 | main.java.srcDirs += 'src/main/kotlin'
31 | }
32 |
33 | defaultConfig {
34 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
35 | applicationId "com.madlonkay.flutter_charset_detector_example"
36 | minSdkVersion flutter.minSdkVersion
37 | targetSdkVersion flutter.targetSdkVersion
38 | versionCode flutterVersionCode.toInteger()
39 | versionName flutterVersionName
40 | }
41 |
42 | buildTypes {
43 | release {
44 | // TODO: Add your own signing config for the release build.
45 | // Signing with the debug keys for now, so `flutter run --release` works.
46 | signingConfig signingConfigs.debug
47 | }
48 | }
49 | }
50 |
51 | flutter {
52 | source '../..'
53 | }
54 |
55 | dependencies {}
56 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
18 |
22 |
27 |
31 |
32 |
33 |
34 |
35 |
36 |
38 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/app/src/main/kotlin/com/madlonkay/flutter_charset_detector_example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.madlonkay.flutter_charset_detector_example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 | }
7 |
8 | rootProject.buildDir = '../build'
9 | subprojects {
10 | project.buildDir = "${rootProject.buildDir}/${project.name}"
11 | }
12 | subprojects {
13 | project.evaluationDependsOn(':app')
14 | }
15 |
16 | tasks.register("clean", Delete) {
17 | delete rootProject.buildDir
18 | }
19 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 | android.defaults.buildfeatures.buildconfig=true
5 | android.nonTransitiveRClass=false
6 | android.nonFinalResIds=false
7 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | def flutterSdkPath = {
3 | def properties = new Properties()
4 | file("local.properties").withInputStream { properties.load(it) }
5 | def flutterSdkPath = properties.getProperty("flutter.sdk")
6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7 | return flutterSdkPath
8 | }()
9 |
10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11 |
12 | repositories {
13 | google()
14 | mavenCentral()
15 | gradlePluginPortal()
16 | }
17 | }
18 |
19 | plugins {
20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21 | id "com.android.application" version "8.1.1" apply false
22 | id "org.jetbrains.kotlin.android" version "1.7.10" apply false
23 | }
24 |
25 | include ":app"
26 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/assets/sjis-example.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/assets/sjis-example.txt
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 12.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '12.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - flutter_charset_detector_darwin (0.0.1):
4 | - Flutter
5 | - FlutterMacOS
6 | - UniversalDetector2 (= 2.0.1)
7 | - UniversalDetector2 (2.0.1)
8 |
9 | DEPENDENCIES:
10 | - Flutter (from `Flutter`)
11 | - flutter_charset_detector_darwin (from `.symlinks/plugins/flutter_charset_detector_darwin/darwin`)
12 |
13 | SPEC REPOS:
14 | trunk:
15 | - UniversalDetector2
16 |
17 | EXTERNAL SOURCES:
18 | Flutter:
19 | :path: Flutter
20 | flutter_charset_detector_darwin:
21 | :path: ".symlinks/plugins/flutter_charset_detector_darwin/darwin"
22 |
23 | SPEC CHECKSUMS:
24 | Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
25 | flutter_charset_detector_darwin: fb3692d6d72cb6afcce7b0dd1a9516be6e78556e
26 | UniversalDetector2: 7c9ffd935cf050eeb19edf7e90f6febe3743a1af
27 |
28 | PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011
29 |
30 | COCOAPODS: 1.14.3
31 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | flutter_charset_detector_example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 | CADisableMinimumFrameDurationOnPhone
45 |
46 | UIApplicationSupportsIndirectInputEvents
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 |
4 | import 'package:flutter/material.dart';
5 | import 'package:flutter/services.dart';
6 | import 'package:flutter_charset_detector/flutter_charset_detector.dart';
7 |
8 | void main() => runApp(const MyApp());
9 |
10 | const _kAssetName = 'assets/sjis-example.txt';
11 |
12 | class MyApp extends StatelessWidget {
13 | const MyApp({super.key});
14 | @override
15 | Widget build(BuildContext context) {
16 | return MaterialApp(
17 | home: Scaffold(
18 | appBar: AppBar(
19 | title: const Text('Charset Detector Example'),
20 | ),
21 | body: ListView(
22 | padding: const EdgeInsets.all(8),
23 | children: const [
24 | _DefaultCharsetCard(_kAssetName),
25 | _DefaultCharsetReplacingCard(_kAssetName),
26 | _DetectedCharsetCard(_kAssetName),
27 | _DetectedOnlyCharsetCard(_kAssetName),
28 | ],
29 | ),
30 | ),
31 | );
32 | }
33 | }
34 |
35 | class _DefaultCharsetCard extends StatelessWidget {
36 | const _DefaultCharsetCard(this.asset);
37 | final String asset;
38 | @override
39 | Widget build(BuildContext context) {
40 | return _LoadedTextCard(
41 | title: 'Default Charset (UTF-8)',
42 | content: rootBundle.loadString(asset),
43 | );
44 | }
45 | }
46 |
47 | class _DefaultCharsetReplacingCard extends StatelessWidget {
48 | const _DefaultCharsetReplacingCard(this.asset);
49 | final String asset;
50 | @override
51 | Widget build(BuildContext context) {
52 | return _LoadedTextCard(
53 | title: 'UTF-8 (allow malformed)',
54 | content: _load(),
55 | );
56 | }
57 |
58 | Future _load() async {
59 | final bytes = await rootBundle.load(asset);
60 | return utf8.decode(bytes.buffer.asUint8List(), allowMalformed: true);
61 | }
62 | }
63 |
64 | class _DetectedCharsetCard extends StatelessWidget {
65 | const _DetectedCharsetCard(this.asset);
66 | final String asset;
67 | @override
68 | Widget build(BuildContext context) {
69 | return FutureBuilder(
70 | future: _load(),
71 | builder: (context, snapshot) {
72 | final charset = snapshot.data?.charset ?? '?';
73 | return _LoadedTextCard(
74 | title: 'Detected Charset: $charset',
75 | content: snapshot.data?.string,
76 | );
77 | },
78 | );
79 | }
80 |
81 | Future _load() async {
82 | final bytes = await rootBundle.load(asset);
83 | return CharsetDetector.autoDecode(bytes.buffer.asUint8List());
84 | }
85 | }
86 |
87 | class _DetectedOnlyCharsetCard extends StatelessWidget {
88 | const _DetectedOnlyCharsetCard(this.asset);
89 | final String asset;
90 | @override
91 | Widget build(BuildContext context) {
92 | return FutureBuilder(
93 | future: _load(),
94 | builder: (context, snapshot) {
95 | final charset = snapshot.data ?? '?';
96 | return _LoadedTextCard(
97 | title: 'Detection only: $charset',
98 | content: null,
99 | );
100 | },
101 | );
102 | }
103 |
104 | Future _load() async {
105 | final bytes = await rootBundle.load(asset);
106 | return CharsetDetector.detect(bytes.buffer.asUint8List());
107 | }
108 | }
109 |
110 | class _LoadedTextCard extends StatelessWidget {
111 | const _LoadedTextCard({required this.title, required this.content});
112 |
113 | final String title;
114 | final FutureOr? content;
115 |
116 | @override
117 | Widget build(BuildContext context) {
118 | return _TitleCard(
119 | title: title,
120 | child: FutureBuilder(
121 | future: Future.value(content),
122 | initialData: 'Loading...',
123 | builder: (context, snapshot) => Container(
124 | padding: const EdgeInsets.all(8),
125 | decoration: BoxDecoration(
126 | color: Colors.grey.shade100,
127 | borderRadius: const BorderRadius.all(Radius.circular(2)),
128 | ),
129 | child: Text(snapshot.data?.trim() ?? snapshot.error.toString()),
130 | ),
131 | ),
132 | );
133 | }
134 | }
135 |
136 | class _TitleCard extends StatelessWidget {
137 | const _TitleCard({required this.title, required this.child});
138 |
139 | final String title;
140 | final Widget child;
141 | @override
142 | Widget build(BuildContext context) {
143 | return Card(
144 | child: Padding(
145 | padding: const EdgeInsets.all(16),
146 | child: Column(
147 | crossAxisAlignment: CrossAxisAlignment.start,
148 | children: [
149 | Text(
150 | title,
151 | style: Theme.of(context).textTheme.titleLarge,
152 | ),
153 | const SizedBox(height: 16),
154 | child,
155 | ],
156 | ),
157 | ),
158 | );
159 | }
160 | }
161 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import flutter_charset_detector_darwin
9 |
10 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
11 | FlutterCharsetDetectorPlugin.register(with: registry.registrar(forPlugin: "FlutterCharsetDetectorPlugin"))
12 | }
13 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Podfile:
--------------------------------------------------------------------------------
1 | platform :osx, '10.14'
2 |
3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5 |
6 | project 'Runner', {
7 | 'Debug' => :debug,
8 | 'Profile' => :release,
9 | 'Release' => :release,
10 | }
11 |
12 | def flutter_root
13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
14 | unless File.exist?(generated_xcode_build_settings_path)
15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
16 | end
17 |
18 | File.foreach(generated_xcode_build_settings_path) do |line|
19 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
20 | return matches[1].strip if matches
21 | end
22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
23 | end
24 |
25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
26 |
27 | flutter_macos_podfile_setup
28 |
29 | target 'Runner' do
30 | use_frameworks!
31 | use_modular_headers!
32 |
33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
34 | target 'RunnerTests' do
35 | inherit! :search_paths
36 | end
37 | end
38 |
39 | post_install do |installer|
40 | installer.pods_project.targets.each do |target|
41 | flutter_additional_macos_build_settings(target)
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - flutter_charset_detector_darwin (0.0.1):
3 | - Flutter
4 | - FlutterMacOS
5 | - UniversalDetector2 (= 2.0.1)
6 | - FlutterMacOS (1.0.0)
7 | - UniversalDetector2 (2.0.1)
8 |
9 | DEPENDENCIES:
10 | - flutter_charset_detector_darwin (from `Flutter/ephemeral/.symlinks/plugins/flutter_charset_detector_darwin/darwin`)
11 | - FlutterMacOS (from `Flutter/ephemeral`)
12 |
13 | SPEC REPOS:
14 | trunk:
15 | - UniversalDetector2
16 |
17 | EXTERNAL SOURCES:
18 | flutter_charset_detector_darwin:
19 | :path: Flutter/ephemeral/.symlinks/plugins/flutter_charset_detector_darwin/darwin
20 | FlutterMacOS:
21 | :path: Flutter/ephemeral
22 |
23 | SPEC CHECKSUMS:
24 | flutter_charset_detector_darwin: fb3692d6d72cb6afcce7b0dd1a9516be6e78556e
25 | FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
26 | UniversalDetector2: 7c9ffd935cf050eeb19edf7e90f6febe3743a1af
27 |
28 | PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
29 |
30 | COCOAPODS: 1.14.3
31 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
43 |
49 |
50 |
51 |
52 |
53 |
63 |
65 |
71 |
72 |
73 |
74 |
80 |
82 |
88 |
89 |
90 |
91 |
93 |
94 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @NSApplicationMain
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "app_icon_16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "app_icon_32.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "app_icon_32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "app_icon_64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "app_icon_128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "app_icon_256.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "app_icon_256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "app_icon_512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "app_icon_512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "app_icon_1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Base.lproj/MainMenu.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = example
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.madlonkay.example
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2024 com.madlonkay. All rights reserved.
15 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/macos/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
9 | url: "https://pub.dev"
10 | source: hosted
11 | version: "2.12.0"
12 | boolean_selector:
13 | dependency: transitive
14 | description:
15 | name: boolean_selector
16 | sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
17 | url: "https://pub.dev"
18 | source: hosted
19 | version: "2.1.2"
20 | characters:
21 | dependency: transitive
22 | description:
23 | name: characters
24 | sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
25 | url: "https://pub.dev"
26 | source: hosted
27 | version: "1.4.0"
28 | clock:
29 | dependency: transitive
30 | description:
31 | name: clock
32 | sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
33 | url: "https://pub.dev"
34 | source: hosted
35 | version: "1.1.2"
36 | collection:
37 | dependency: transitive
38 | description:
39 | name: collection
40 | sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
41 | url: "https://pub.dev"
42 | source: hosted
43 | version: "1.19.1"
44 | fake_async:
45 | dependency: transitive
46 | description:
47 | name: fake_async
48 | sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
49 | url: "https://pub.dev"
50 | source: hosted
51 | version: "1.3.2"
52 | flutter:
53 | dependency: "direct main"
54 | description: flutter
55 | source: sdk
56 | version: "0.0.0"
57 | flutter_charset_detector:
58 | dependency: "direct main"
59 | description:
60 | path: ".."
61 | relative: true
62 | source: path
63 | version: "5.0.0"
64 | flutter_charset_detector_android:
65 | dependency: transitive
66 | description:
67 | name: flutter_charset_detector_android
68 | sha256: "443145e8fc8515b3b32aee375691e40dd59197a86a2ae153166bc88c8200d83b"
69 | url: "https://pub.dev"
70 | source: hosted
71 | version: "3.0.0"
72 | flutter_charset_detector_darwin:
73 | dependency: transitive
74 | description:
75 | name: flutter_charset_detector_darwin
76 | sha256: daac20390275efb92fbb14350fe11286c5e29c7b80d6b0867f52d760f0d69763
77 | url: "https://pub.dev"
78 | source: hosted
79 | version: "1.1.0"
80 | flutter_charset_detector_platform_interface:
81 | dependency: transitive
82 | description:
83 | name: flutter_charset_detector_platform_interface
84 | sha256: "1c09ed7b314a5a9dde76057b98b7d35458ba881eed03d5e5b6f7f74b4869d18c"
85 | url: "https://pub.dev"
86 | source: hosted
87 | version: "1.1.0"
88 | flutter_charset_detector_web:
89 | dependency: transitive
90 | description:
91 | name: flutter_charset_detector_web
92 | sha256: e3ac65f94b12f4887937b21a19365d7927db816840cb93274e3861241cb0e9f2
93 | url: "https://pub.dev"
94 | source: hosted
95 | version: "2.0.0"
96 | flutter_lints:
97 | dependency: "direct dev"
98 | description:
99 | name: flutter_lints
100 | sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
101 | url: "https://pub.dev"
102 | source: hosted
103 | version: "4.0.0"
104 | flutter_test:
105 | dependency: "direct dev"
106 | description: flutter
107 | source: sdk
108 | version: "0.0.0"
109 | flutter_web_plugins:
110 | dependency: transitive
111 | description: flutter
112 | source: sdk
113 | version: "0.0.0"
114 | leak_tracker:
115 | dependency: transitive
116 | description:
117 | name: leak_tracker
118 | sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
119 | url: "https://pub.dev"
120 | source: hosted
121 | version: "10.0.8"
122 | leak_tracker_flutter_testing:
123 | dependency: transitive
124 | description:
125 | name: leak_tracker_flutter_testing
126 | sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
127 | url: "https://pub.dev"
128 | source: hosted
129 | version: "3.0.9"
130 | leak_tracker_testing:
131 | dependency: transitive
132 | description:
133 | name: leak_tracker_testing
134 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
135 | url: "https://pub.dev"
136 | source: hosted
137 | version: "3.0.1"
138 | lints:
139 | dependency: transitive
140 | description:
141 | name: lints
142 | sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
143 | url: "https://pub.dev"
144 | source: hosted
145 | version: "4.0.0"
146 | matcher:
147 | dependency: transitive
148 | description:
149 | name: matcher
150 | sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
151 | url: "https://pub.dev"
152 | source: hosted
153 | version: "0.12.17"
154 | material_color_utilities:
155 | dependency: transitive
156 | description:
157 | name: material_color_utilities
158 | sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
159 | url: "https://pub.dev"
160 | source: hosted
161 | version: "0.11.1"
162 | meta:
163 | dependency: transitive
164 | description:
165 | name: meta
166 | sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
167 | url: "https://pub.dev"
168 | source: hosted
169 | version: "1.16.0"
170 | path:
171 | dependency: transitive
172 | description:
173 | name: path
174 | sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
175 | url: "https://pub.dev"
176 | source: hosted
177 | version: "1.9.1"
178 | plugin_platform_interface:
179 | dependency: transitive
180 | description:
181 | name: plugin_platform_interface
182 | sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
183 | url: "https://pub.dev"
184 | source: hosted
185 | version: "2.1.8"
186 | sky_engine:
187 | dependency: transitive
188 | description: flutter
189 | source: sdk
190 | version: "0.0.0"
191 | source_span:
192 | dependency: transitive
193 | description:
194 | name: source_span
195 | sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
196 | url: "https://pub.dev"
197 | source: hosted
198 | version: "1.10.1"
199 | stack_trace:
200 | dependency: transitive
201 | description:
202 | name: stack_trace
203 | sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
204 | url: "https://pub.dev"
205 | source: hosted
206 | version: "1.12.1"
207 | stream_channel:
208 | dependency: transitive
209 | description:
210 | name: stream_channel
211 | sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
212 | url: "https://pub.dev"
213 | source: hosted
214 | version: "2.1.4"
215 | string_scanner:
216 | dependency: transitive
217 | description:
218 | name: string_scanner
219 | sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
220 | url: "https://pub.dev"
221 | source: hosted
222 | version: "1.4.1"
223 | term_glyph:
224 | dependency: transitive
225 | description:
226 | name: term_glyph
227 | sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
228 | url: "https://pub.dev"
229 | source: hosted
230 | version: "1.2.2"
231 | test_api:
232 | dependency: transitive
233 | description:
234 | name: test_api
235 | sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
236 | url: "https://pub.dev"
237 | source: hosted
238 | version: "0.7.4"
239 | vector_math:
240 | dependency: transitive
241 | description:
242 | name: vector_math
243 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
244 | url: "https://pub.dev"
245 | source: hosted
246 | version: "2.1.4"
247 | vm_service:
248 | dependency: transitive
249 | description:
250 | name: vm_service
251 | sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
252 | url: "https://pub.dev"
253 | source: hosted
254 | version: "14.3.1"
255 | sdks:
256 | dart: ">=3.7.0-0 <4.0.0"
257 | flutter: ">=3.18.0-18.0.pre.54"
258 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_charset_detector_example
2 | description: Demonstrates how to use the flutter_charset_detector plugin.
3 |
4 | publish_to: 'none'
5 |
6 | environment:
7 | sdk: '>=3.0.0 <4.0.0'
8 |
9 | dependencies:
10 | flutter:
11 | sdk: flutter
12 |
13 | flutter_charset_detector:
14 | path: ../
15 |
16 | dev_dependencies:
17 | flutter_lints: ^4.0.0
18 | flutter_test:
19 | sdk: flutter
20 |
21 | flutter:
22 | uses-material-design: true
23 | assets:
24 | - assets/sjis-example.txt
25 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_charset_detector_example/main.dart';
5 | import 'package:flutter_test/flutter_test.dart';
6 |
7 | void main() {
8 | testWidgets('Launch app', (tester) async {
9 | await runZonedGuarded(() async {
10 | await tester.pumpWidget(const MyApp());
11 | expect(
12 | find.byWidgetPredicate((widget) =>
13 | widget is Text && widget.data!.startsWith('Default Charset')),
14 | findsOneWidget,
15 | );
16 | }, (error, stack) {
17 | expectSync(error, isA());
18 | });
19 | });
20 | }
21 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/web/favicon.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amake/flutter_charset_detector/5d32e065b12bd48765db9122f99e20af8bbab5c1/flutter_charset_detector/example/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/flutter_charset_detector/example/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | example
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/flutter_charset_detector/example/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example",
3 | "short_name": "example",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/flutter_charset_detector/lib/flutter_charset_detector.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:typed_data';
3 |
4 | import 'package:flutter_charset_detector_platform_interface/decoding_result.dart';
5 | import 'package:flutter_charset_detector_platform_interface/flutter_charset_detector_platform_interface.dart';
6 |
7 | export 'package:flutter_charset_detector_platform_interface/decoding_result.dart';
8 |
9 | CharsetDetectorPlatform get _platform => CharsetDetectorPlatform.instance;
10 |
11 | // Legacy wrapper class for backwards compatibility
12 | class CharsetDetector {
13 | /// Automatically detect the charset of [bytes] and decode to a string.
14 | static Future autoDecode(Uint8List bytes) =>
15 | _platform.autoDecode(bytes);
16 |
17 | /// Detect and return the charset of [bytes].
18 | static Future detect(Uint8List bytes) => _platform.detect(bytes);
19 | }
20 |
--------------------------------------------------------------------------------
/flutter_charset_detector/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
9 | url: "https://pub.dev"
10 | source: hosted
11 | version: "2.12.0"
12 | boolean_selector:
13 | dependency: transitive
14 | description:
15 | name: boolean_selector
16 | sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
17 | url: "https://pub.dev"
18 | source: hosted
19 | version: "2.1.2"
20 | characters:
21 | dependency: transitive
22 | description:
23 | name: characters
24 | sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
25 | url: "https://pub.dev"
26 | source: hosted
27 | version: "1.4.0"
28 | clock:
29 | dependency: transitive
30 | description:
31 | name: clock
32 | sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
33 | url: "https://pub.dev"
34 | source: hosted
35 | version: "1.1.2"
36 | collection:
37 | dependency: transitive
38 | description:
39 | name: collection
40 | sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
41 | url: "https://pub.dev"
42 | source: hosted
43 | version: "1.19.1"
44 | fake_async:
45 | dependency: transitive
46 | description:
47 | name: fake_async
48 | sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
49 | url: "https://pub.dev"
50 | source: hosted
51 | version: "1.3.2"
52 | flutter:
53 | dependency: "direct main"
54 | description: flutter
55 | source: sdk
56 | version: "0.0.0"
57 | flutter_charset_detector_android:
58 | dependency: "direct main"
59 | description:
60 | name: flutter_charset_detector_android
61 | sha256: "443145e8fc8515b3b32aee375691e40dd59197a86a2ae153166bc88c8200d83b"
62 | url: "https://pub.dev"
63 | source: hosted
64 | version: "3.0.0"
65 | flutter_charset_detector_darwin:
66 | dependency: "direct main"
67 | description:
68 | name: flutter_charset_detector_darwin
69 | sha256: daac20390275efb92fbb14350fe11286c5e29c7b80d6b0867f52d760f0d69763
70 | url: "https://pub.dev"
71 | source: hosted
72 | version: "1.1.0"
73 | flutter_charset_detector_platform_interface:
74 | dependency: "direct main"
75 | description:
76 | name: flutter_charset_detector_platform_interface
77 | sha256: "1c09ed7b314a5a9dde76057b98b7d35458ba881eed03d5e5b6f7f74b4869d18c"
78 | url: "https://pub.dev"
79 | source: hosted
80 | version: "1.1.0"
81 | flutter_charset_detector_web:
82 | dependency: "direct main"
83 | description:
84 | name: flutter_charset_detector_web
85 | sha256: e3ac65f94b12f4887937b21a19365d7927db816840cb93274e3861241cb0e9f2
86 | url: "https://pub.dev"
87 | source: hosted
88 | version: "2.0.0"
89 | flutter_lints:
90 | dependency: "direct dev"
91 | description:
92 | name: flutter_lints
93 | sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
94 | url: "https://pub.dev"
95 | source: hosted
96 | version: "5.0.0"
97 | flutter_test:
98 | dependency: "direct dev"
99 | description: flutter
100 | source: sdk
101 | version: "0.0.0"
102 | flutter_web_plugins:
103 | dependency: transitive
104 | description: flutter
105 | source: sdk
106 | version: "0.0.0"
107 | leak_tracker:
108 | dependency: transitive
109 | description:
110 | name: leak_tracker
111 | sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
112 | url: "https://pub.dev"
113 | source: hosted
114 | version: "10.0.8"
115 | leak_tracker_flutter_testing:
116 | dependency: transitive
117 | description:
118 | name: leak_tracker_flutter_testing
119 | sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
120 | url: "https://pub.dev"
121 | source: hosted
122 | version: "3.0.9"
123 | leak_tracker_testing:
124 | dependency: transitive
125 | description:
126 | name: leak_tracker_testing
127 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
128 | url: "https://pub.dev"
129 | source: hosted
130 | version: "3.0.1"
131 | lints:
132 | dependency: transitive
133 | description:
134 | name: lints
135 | sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7
136 | url: "https://pub.dev"
137 | source: hosted
138 | version: "5.1.1"
139 | matcher:
140 | dependency: transitive
141 | description:
142 | name: matcher
143 | sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
144 | url: "https://pub.dev"
145 | source: hosted
146 | version: "0.12.17"
147 | material_color_utilities:
148 | dependency: transitive
149 | description:
150 | name: material_color_utilities
151 | sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
152 | url: "https://pub.dev"
153 | source: hosted
154 | version: "0.11.1"
155 | meta:
156 | dependency: transitive
157 | description:
158 | name: meta
159 | sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
160 | url: "https://pub.dev"
161 | source: hosted
162 | version: "1.16.0"
163 | path:
164 | dependency: transitive
165 | description:
166 | name: path
167 | sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
168 | url: "https://pub.dev"
169 | source: hosted
170 | version: "1.9.1"
171 | plugin_platform_interface:
172 | dependency: "direct dev"
173 | description:
174 | name: plugin_platform_interface
175 | sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
176 | url: "https://pub.dev"
177 | source: hosted
178 | version: "2.1.8"
179 | sky_engine:
180 | dependency: transitive
181 | description: flutter
182 | source: sdk
183 | version: "0.0.0"
184 | source_span:
185 | dependency: transitive
186 | description:
187 | name: source_span
188 | sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
189 | url: "https://pub.dev"
190 | source: hosted
191 | version: "1.10.1"
192 | stack_trace:
193 | dependency: transitive
194 | description:
195 | name: stack_trace
196 | sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
197 | url: "https://pub.dev"
198 | source: hosted
199 | version: "1.12.1"
200 | stream_channel:
201 | dependency: transitive
202 | description:
203 | name: stream_channel
204 | sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
205 | url: "https://pub.dev"
206 | source: hosted
207 | version: "2.1.4"
208 | string_scanner:
209 | dependency: transitive
210 | description:
211 | name: string_scanner
212 | sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
213 | url: "https://pub.dev"
214 | source: hosted
215 | version: "1.4.1"
216 | term_glyph:
217 | dependency: transitive
218 | description:
219 | name: term_glyph
220 | sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
221 | url: "https://pub.dev"
222 | source: hosted
223 | version: "1.2.2"
224 | test_api:
225 | dependency: transitive
226 | description:
227 | name: test_api
228 | sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
229 | url: "https://pub.dev"
230 | source: hosted
231 | version: "0.7.4"
232 | vector_math:
233 | dependency: transitive
234 | description:
235 | name: vector_math
236 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
237 | url: "https://pub.dev"
238 | source: hosted
239 | version: "2.1.4"
240 | vm_service:
241 | dependency: transitive
242 | description:
243 | name: vm_service
244 | sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
245 | url: "https://pub.dev"
246 | source: hosted
247 | version: "14.3.1"
248 | sdks:
249 | dart: ">=3.7.0-0 <4.0.0"
250 | flutter: ">=3.18.0-18.0.pre.54"
251 |
--------------------------------------------------------------------------------
/flutter_charset_detector/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_charset_detector
2 | description: Detect and decode the charset (character encoding) of text bytes
3 | version: 5.0.0
4 | homepage: https://github.com/amake/flutter_charset_detector
5 |
6 | environment:
7 | sdk: '>=2.12.0 <4.0.0'
8 | flutter: '>=1.20.0'
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 | flutter_charset_detector_android: ^3.0.0
14 | # flutter_charset_detector_android:
15 | # path: ../flutter_charset_detector_android
16 | flutter_charset_detector_darwin: ^1.1.0
17 | # flutter_charset_detector_darwin:
18 | # path: ../flutter_charset_detector_darwin
19 | flutter_charset_detector_web: ^2.0.0
20 | # flutter_charset_detector_web:
21 | # path: ../flutter_charset_detector_web
22 | flutter_charset_detector_platform_interface: ^1.1.0
23 | # flutter_charset_detector_platform_interface:
24 | # path: ../flutter_charset_detector_platform_interface
25 |
26 | dev_dependencies:
27 | flutter_lints: ^5.0.0
28 | flutter_test:
29 | sdk: flutter
30 | plugin_platform_interface: ^2.0.1
31 |
32 | flutter:
33 | plugin:
34 | platforms:
35 | android:
36 | default_package: flutter_charset_detector_android
37 | ios:
38 | default_package: flutter_charset_detector_darwin
39 | macos:
40 | default_package: flutter_charset_detector_darwin
41 | web:
42 | default_package: flutter_charset_detector_web
43 |
44 | topics:
45 | - text
46 | - encoding
47 | - charset
48 | - detection
49 | - flutter
50 |
--------------------------------------------------------------------------------
/flutter_charset_detector/test/flutter_charset_detector_test.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter/services.dart';
4 | import 'package:flutter_charset_detector/flutter_charset_detector.dart';
5 | import 'package:flutter_test/flutter_test.dart';
6 |
7 | void main() {
8 | const channel = MethodChannel('flutter_charset_detector');
9 |
10 | TestWidgetsFlutterBinding.ensureInitialized();
11 |
12 | setUp(() {
13 | TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
14 | .setMockMethodCallHandler(channel, (methodCall) async {
15 | switch (methodCall.method) {
16 | case 'autoDecode':
17 | final args = methodCall.arguments as Map;
18 | return {
19 | 'string': utf8.decode(args['data'] as Uint8List),
20 | 'charset': utf8.name,
21 | };
22 | case 'detect':
23 | return 'utf-8';
24 | default:
25 | throw PlatformException(code: 'foo');
26 | }
27 | });
28 | });
29 |
30 | tearDown(() {
31 | TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
32 | .setMockMethodCallHandler(channel, null);
33 | });
34 |
35 | test('testAutoDecode', () async {
36 | const string = 'blah';
37 | final bytes = Uint8List.fromList(utf8.encode(string));
38 | final result = await CharsetDetector.autoDecode(bytes);
39 | expect(result.charset, 'utf-8');
40 | expect(result.string, string);
41 | });
42 | test('testDetect', () async {
43 | const string = 'blah';
44 | final bytes = Uint8List.fromList(utf8.encode(string));
45 | final result = await CharsetDetector.detect(bytes);
46 | expect(result, 'utf-8');
47 | });
48 | }
49 |
--------------------------------------------------------------------------------
/flutter_charset_detector_android/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 81a45ec2e5f80fa71d5135f1702ce540558b416d
8 | channel: beta
9 |
10 | project_type: plugin
11 |
--------------------------------------------------------------------------------
/flutter_charset_detector_android/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 3.0.0
2 | * Bump juniversalchardet to 2.5.0
3 | * Bump Kotlin to 1.7.10
4 | * Bump compileSdk to 34
5 | * Bump minSdk to 21
6 |
7 | ## 2.1.1
8 | * Fix errors
9 |
10 | ## 2.1.0
11 | * Add `detect` method to obtain the detected charset without decoding the
12 | supplied bytes
13 |
14 | ## 2.0.1
15 | * Fix type cast error introduced in 2.0.0
16 |
17 | ## 2.0.0
18 | * Move to Android Gradle Plugin 8
19 |
20 | ## 1.0.0
21 |
22 | * Initial release
23 |
--------------------------------------------------------------------------------
/flutter_charset_detector_android/README.md:
--------------------------------------------------------------------------------
1 | # flutter\_charset\_detector\_android
2 |
3 | The Android implementation of [`flutter_charset_detector`][1].
4 |
5 | ## Usage
6 |
7 | This package is [endorsed][2], which means you can simply use
8 | `flutter_charset_detector` normally. This package will be automatically included
9 | in your app when you do.
10 |
11 | [1]: https://pub.dev/packages/flutter_charset_detector
12 | [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin
13 |
--------------------------------------------------------------------------------
/flutter_charset_detector_android/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
3 | analyzer:
4 | language:
5 | strict-casts: true
6 | strict-inference: true
7 | strict-raw-types: true
8 |
--------------------------------------------------------------------------------
/flutter_charset_detector_android/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/flutter_charset_detector_android/android/build.gradle:
--------------------------------------------------------------------------------
1 | group 'com.madlonkay.flutter_charset_detector'
2 | version '1.0-SNAPSHOT'
3 |
4 | buildscript {
5 | ext.kotlin_version = '1.7.10'
6 | repositories {
7 | google()
8 | mavenCentral()
9 | }
10 |
11 | dependencies {
12 | classpath 'com.android.tools.build:gradle:8.1.1'
13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | mavenCentral()
21 | }
22 | }
23 |
24 | apply plugin: 'com.android.library'
25 | apply plugin: 'kotlin-android'
26 |
27 | android {
28 | namespace 'com.madlonkay.flutter_charset_detector'
29 |
30 | compileSdk = 34
31 |
32 | compileOptions {
33 | sourceCompatibility = JavaVersion.VERSION_1_8
34 | targetCompatibility = JavaVersion.VERSION_1_8
35 | }
36 |
37 | kotlinOptions {
38 | jvmTarget = '1.8'
39 | }
40 |
41 | sourceSets {
42 | main.java.srcDirs += 'src/main/kotlin'
43 | }
44 |
45 | defaultConfig {
46 | minSdk = 21
47 | }
48 | }
49 |
50 | dependencies {
51 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
52 | implementation 'com.github.albfernandez:juniversalchardet:2.5.0'
53 | }
54 |
--------------------------------------------------------------------------------
/flutter_charset_detector_android/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 | android.defaults.buildfeatures.buildconfig=true
5 | android.nonTransitiveRClass=false
6 | android.nonFinalResIds=false
7 |
--------------------------------------------------------------------------------
/flutter_charset_detector_android/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Sep 22 00:09:07 JST 2023
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/flutter_charset_detector_android/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'flutter_charset_detector'
2 |
--------------------------------------------------------------------------------
/flutter_charset_detector_android/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/flutter_charset_detector_android/android/src/main/kotlin/com/madlonkay/flutter_charset_detector/FlutterCharsetDetectorPlugin.kt:
--------------------------------------------------------------------------------
1 | package com.madlonkay.flutter_charset_detector
2 |
3 | import androidx.annotation.NonNull
4 | import io.flutter.embedding.engine.plugins.FlutterPlugin
5 | import io.flutter.plugin.common.MethodCall
6 | import io.flutter.plugin.common.MethodChannel
7 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler
8 | import io.flutter.plugin.common.MethodChannel.Result
9 | import org.mozilla.universalchardet.UniversalDetector
10 | import java.nio.ByteBuffer
11 | import java.nio.charset.Charset
12 | import java.nio.charset.IllegalCharsetNameException
13 | import java.nio.charset.UnsupportedCharsetException
14 |
15 | /** FlutterCharsetDetectorPlugin */
16 | class FlutterCharsetDetectorPlugin : FlutterPlugin, MethodCallHandler {
17 | private lateinit var channel: MethodChannel
18 |
19 | override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
20 | channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flutter_charset_detector")
21 | channel.setMethodCallHandler(this)
22 | }
23 |
24 | override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
25 | when (call.method) {
26 | "autoDecode" -> handleAutoDecode(call, result)
27 | "detect" -> handleDetect(call, result)
28 | else -> result.notImplemented()
29 | }
30 | }
31 |
32 | private fun handleAutoDecode(call: MethodCall, result: Result) {
33 | val data = call.argument("data")
34 | if (data == null) {
35 | result.error("MissingArg", "Required argument missing", "${call.method} requires 'data'")
36 | return
37 | }
38 | val charsetName = data.inputStream().use(UniversalDetector::detectCharset)
39 | if (charsetName == null) {
40 | result.error("DetectionFailed", "The charset could not be detected", null)
41 | return
42 | }
43 | val charset: Charset = try {
44 | Charset.forName(charsetName)
45 | } catch (e: Exception) {
46 | when (e) {
47 | is IllegalCharsetNameException,
48 | is UnsupportedCharsetException -> {
49 | result.error("UnsupportedCharset", "The detected charset $charsetName is not supported.", null)
50 | return
51 | }
52 | else -> throw e
53 | }
54 | }
55 | val string = charset.decode(ByteBuffer.wrap(data)).toString()
56 | result.success(
57 | mapOf(
58 | "charset" to charsetName,
59 | "string" to string
60 | )
61 | )
62 | }
63 |
64 | private fun handleDetect(call: MethodCall, result: Result) {
65 | val data = call.argument("data")
66 | if (data == null) {
67 | result.error("MissingArg", "Required argument missing", "${call.method} requires 'data'")
68 | return
69 | }
70 | val charsetName = data.inputStream().use(UniversalDetector::detectCharset)
71 | if (charsetName == null) {
72 | result.error("DetectionFailed", "The charset could not be detected", null)
73 | return
74 | }
75 | result.success(charsetName)
76 | }
77 |
78 | override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
79 | channel.setMethodCallHandler(null)
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/flutter_charset_detector_android/lib/flutter_charset_detector_android.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/services.dart';
2 | import 'package:flutter_charset_detector_platform_interface/decoding_result.dart';
3 | import 'package:flutter_charset_detector_platform_interface/flutter_charset_detector_platform_interface.dart';
4 |
5 | class CharsetDetectorAndroid extends CharsetDetectorPlatform {
6 | /// The method channel used to interact with the native platform.
7 | static const MethodChannel _channel =
8 | MethodChannel('flutter_charset_detector');
9 |
10 | /// Registers this class as the default instance of [CharsetDetectorPlatform]
11 | static void registerWith() =>
12 | CharsetDetectorPlatform.instance = CharsetDetectorAndroid();
13 |
14 | /// Automatically detect the charset of [bytes] and decode to a string.
15 | @override
16 | Future autoDecode(Uint8List bytes) async {
17 | final result = await _channel
18 | .invokeMethod