Blue Sky TXT
Blue Sky TXT is a Plain Text sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
01-blue-sky.txtb4ef7c269237079163ffb2047223ccee7efdfe3317e9f2c941e8a9658ca7322dDocument
最も汎用的なプレーンテキスト形式。固定のバイナリシグネチャはありません。
74 69 74 6C 65 3A title:SIGNATURE = bytes.fromhex("7469746c653a")
OFFSET = 0
def is_txt(path: str) -> bool:
with open(path, "rb") as f:
f.seek(OFFSET)
head = f.read(len(SIGNATURE))
return head == SIGNATUREconst SIGNATURE = [0x74, 0x69, 0x74, 0x6c, 0x65, 0x3a];
const OFFSET = 0;
// bytes: a Uint8Array / Buffer holding the start of the file
export function isTxt(bytes) {
return SIGNATURE.every((byte, i) => bytes[OFFSET + i] === byte);
}package fileid
import "bytes"
var istxtSignature = []byte{0x74, 0x69, 0x74, 0x6c, 0x65, 0x3a}
const istxtOffset = 0
func IsTxt(b []byte) bool {
end := istxtOffset + len(istxtSignature)
if len(b) < end {
return false
}
return bytes.Equal(b[istxtOffset:end], istxtSignature)
}const SIGNATURE: &[u8] = &[0x74, 0x69, 0x74, 0x6c, 0x65, 0x3a];
const OFFSET: usize = 0;
fn is_txt(bytes: &[u8]) -> bool {
bytes.get(OFFSET..OFFSET + SIGNATURE.len()) == Some(SIGNATURE)
}<?php
$signature = "\x74\x69\x74\x6c\x65\x3a";
$offset = 0;
function is_txt(string $bytes): bool {
global $signature, $offset;
return substr($bytes, $offset, strlen($signature)) === $signature;
}Plain Text はデータ交換、インポート/エクスポート、パーサのテスト、検証ワークフローで使われます。エンコーディング・区切り文字・バージョン・コンテナ構造が実装の挙動を変えることがあります。
文書形式はスクリプト・添付・マクロ・外部参照を含むことがあります。プレビューや変換はサンドボックス化し、信頼できないファイルを直接開かないでください。
11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。
Blue Sky TXT is a Plain Text sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
01-blue-sky.txtb4ef7c269237079163ffb2047223ccee7efdfe3317e9f2c941e8a9658ca7322dFlower Garden TXT is a Plain Text sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
02-flower-garden.txt4f930a8a4a98e9f60dd45685492ed5f269bed5779df51de835f4800fc8070ff0Navy Blue Sky TXT is a Plain Text sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
03-navy-blue-sky.txt56b479b44e4340cd4db9aa2772c1fbb48483217e0f9ed785a8d0cd2511f1d10bNature of the Sky TXT is a Plain Text sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
04-nature-sky.txt13c9c17e777735a54d7ff404e6ef1c740d50cbbc073b26dfb6fa0a7eb5be8d12Sky Landscape TXT is a Plain Text sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
05-sky-landscape.txt3d3498c21f5f508ea2581aba77104c0de05dba37d0f419efc5b3d4a4a0b5ec51Starry Sky TXT is a Plain Text sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
06-starry-sky.txtd5ab2b30d3fc9dc2e0cdb6bb5e06de8e6741be30f3a6889cfe7900d6416c1c32Blue Night Sky TXT is a Plain Text sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
07-blue-night-sky.txtd3a6fc8972af9b1cad31d5657ff4e8632c509e906316d226621ebce3d0b79e3bHibiscus Flower TXT is a Plain Text sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
08-hibiscus-flower.txt48177ae9a99604b1c63b6bc18a020bfecf0b3b43955bb4fa444ac885817b36ffArctic Sky TXT is a Plain Text sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
09-arctic-sky.txt467cb5ad3ddb4094ad1b73ec6afeff908cd0f01054318532ff6a7230dd689a62Sunset Rays TXT is a Plain Text sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
10-sunset-rays.txt6b35d7b14f369167402135c26254c67f01d2c0cd3e154de7398d8b030aa0109aNASA Blue Marble TXT is a Plain Text sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.
nasa-blue-marble-2012-east.txt9a5f65a9e7e5c69a1b0c66721d65dcacc3376c326454dd931a4724a0be3c7f87Plain Text ファイルはバイトシグネチャ 74 69 74 6C 65 3A ("title:") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。
Plain Text のMIMEタイプは text/plain です。
Plain Text ファイルは .txt, .text 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。