1package( 2 default_visibility = ["//visibility:public"], 3) 4 5licenses(["notice"]) # Apache 2.0 6 7exports_files(["LICENSE"]) 8 9# Data for core MIME/Unix/Windows encodings: 10# ISO 8859-2..9, 15; Windows-125x; EUC-CN; GBK (Windows cp936); GB 18030; 11# Big5 (Windows cp950); SJIS (Windows cp932); EUC-JP; EUC-KR, KS C 5601; 12# Windows cp949. Data is pre-processed for little-endian platforms. To replicate 13# this pre-processing (if you want additional encodings, for example), do the 14# following: 15# 16# First, download, build, and install ICU. This installs tools such as makeconv. 17# Then, run the following from your icu4c/source directory: 18# $ cp [path to filters.json] . 19# $ ICU_DATA_FILTER_FILE=filters.json ./runConfigureICU Linux 20# $ make clean && make 21# $ cd data/out/tmp 22# $ genccode icudt70l.dat # Note: this number must match version, and below too! 23# $ echo 'U_CAPI const void * U_EXPORT2 uprv_getICUData_conversion() { return icudt70l_dat.bytes; }' >> icudt70l_dat.c 24# 25# This creates icudt70l_dat.c, which you can move, rename, gzip, then split, 26# for example (but you can change to other numbers): 27# $ cp icudt70l_dat.c icu_conversion_data.c 28# $ gzip icu_conversion_data.c 29# # Note: make sure you don't forget the last . below! 30# $ split -a 3 -b 100000 icu_conversion_data.c.gz icu_conversion_data.c.gz. 31# 32# Then, copy the generated files to this directory, removing existing ones. 33# 34# The current files have been generated by this filter (in filters.json): 35# { 36# "localeFilter": { 37# "filterType": "language", 38# "includelist": [ 39# "en" 40# ] 41# } 42# } 43# Please make sure to keep this updated if you change the data files. 44filegroup( 45 name = "conversion_files", 46 srcs = glob(["icu_conversion_data.c.gz.*"]), 47) 48 49# Data files are compressed and split to work around git performance degradation 50# around large files. 51genrule( 52 name = "merge_conversion_data", 53 srcs = [":conversion_files"], 54 outs = ["conversion_data.c"], 55 cmd = "cat $(locations :conversion_files) | gunzip > $@", 56) 57 58cc_library( 59 name = "conversion_data", 60 srcs = [":conversion_data.c"], 61 deps = ["@icu//:headers"], 62 alwayslink = 1, 63) 64