Blue Sky RTF
Blue Sky RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
01-blue-sky.rtfca46ce089c878dfc268d903cb18e634fe502455a2500742864a48707e63c6ddcDocument
書式付きテキスト文書形式。Wordなど多くのエディタで開け、通常は{\\rtfから始まります。
7B 5C 72 74 66 {\rtfSIGNATURE = bytes.fromhex("7b5c727466")
OFFSET = 0
def is_rtf(path: str) -> bool:
with open(path, "rb") as f:
f.seek(OFFSET)
head = f.read(len(SIGNATURE))
return head == SIGNATUREconst SIGNATURE = [0x7b, 0x5c, 0x72, 0x74, 0x66];
const OFFSET = 0;
// bytes: a Uint8Array / Buffer holding the start of the file
export function isRtf(bytes) {
return SIGNATURE.every((byte, i) => bytes[OFFSET + i] === byte);
}package fileid
import "bytes"
var isrtfSignature = []byte{0x7b, 0x5c, 0x72, 0x74, 0x66}
const isrtfOffset = 0
func IsRtf(b []byte) bool {
end := isrtfOffset + len(isrtfSignature)
if len(b) < end {
return false
}
return bytes.Equal(b[isrtfOffset:end], isrtfSignature)
}const SIGNATURE: &[u8] = &[0x7b, 0x5c, 0x72, 0x74, 0x66];
const OFFSET: usize = 0;
fn is_rtf(bytes: &[u8]) -> bool {
bytes.get(OFFSET..OFFSET + SIGNATURE.len()) == Some(SIGNATURE)
}<?php
$signature = "\x7b\x5c\x72\x74\x66";
$offset = 0;
function is_rtf(string $bytes): bool {
global $signature, $offset;
return substr($bytes, $offset, strlen($signature)) === $signature;
}Rich Text Format はデータ交換、インポート/エクスポート、パーサのテスト、検証ワークフローで使われます。エンコーディング・区切り文字・バージョン・コンテナ構造が実装の挙動を変えることがあります。
文書形式はスクリプト・添付・マクロ・外部参照を含むことがあります。プレビューや変換はサンドボックス化し、信頼できないファイルを直接開かないでください。
11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。
Blue Sky RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
01-blue-sky.rtfca46ce089c878dfc268d903cb18e634fe502455a2500742864a48707e63c6ddcFlower Garden RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
02-flower-garden.rtf915800782ddea2e4e4bcf64c1de1ea6041ce385f99ce3fd48943aa4de28289aaNavy Blue Sky RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
03-navy-blue-sky.rtf14e55c9ca5e4611245aeafb27928a0a0f2df1e752e889115a64cca98c1155702Nature of the Sky RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
04-nature-sky.rtfb710eefc8fb8b2966bed7a4d98f0a6c213238e9ee43fe6423ffba92b2cc5e901Sky Landscape RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
05-sky-landscape.rtf332089461015ea27eab1e0d60f51d146d349973d9545d65e46164fc47e7ec621Starry Sky RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
06-starry-sky.rtfc3222088a1b69243cf944ab189e61ca4e487077d0f95be7f952adb471d96fd5dBlue Night Sky RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
07-blue-night-sky.rtfffd9fb1fcb1233b02129b1ff29b537a7f10b5d8f1d78a842911a44a68ba768b5Hibiscus Flower RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
08-hibiscus-flower.rtf4d12c8526787593fb26dca21259ee6d13c22ad03f13cae14df94cb3beb794833Arctic Sky RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
09-arctic-sky.rtf9c14832a446200557a1ff38c9a0a066f1cfcfd7c635fa48301f894bdaca4dd15Sunset Rays RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
10-sunset-rays.rtf390d4af0959bf64bc2020ab4ca4eead0f7c14a3c55330a9bd6532b39f3dedb1eNASA Blue Marble RTF is a Rich Text Format 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.rtfe5b07989f55a9da71bfdb9fdcd1e17ea45aea807d25571cca6da9886e0fc908cRich Text Format ファイルはバイトシグネチャ 7B 5C 72 74 66 ("{\rtf") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。
Rich Text Format のMIMEタイプは application/rtf, text/rtf です。
Rich Text Format ファイルは .rtf 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。