Skip to content

Instantly share code, notes, and snippets.

use icu::calendar::cal::{ChineseTraditional};
use icu::calendar::Date;
fn test_calendar(y: i32, m: u8, d: u8) {
// Creating ISO date: 1987-08-15.
let date_iso = Date::try_new_iso(y, m, d)
.expect("Failed to initialize ISO Date instance.");
let chinese = ChineseTraditional::new();
let date_chinese = date_iso.to_calendar(chinese);
#define U_DISABLE_RENAMING 1
#include <stdio.h>
#include "unicode/utypes.h"
#include "unicode/uenum.h"
#include "unicode/uloc.h"
#include "unicode/localpointer.h"
#include "unicode/ucal.h"
#include "unicode/calendar.h"
@catamorphism
catamorphism / gist:6e4f052be2ae4cf9ae82f441426e8947
Created November 12, 2025 22:37
MessageFormat example with ICU 78
#define U_DISABLE_RENAMING 1
#include <unicode/messageformat2.h>
#include <iostream>
#include <unicode/unistr.h>
#include <unicode/ustream.h>
using namespace std;
using namespace icu;
using namespace message2;
$ RUST_BACKTRACE=1 $WASI_SDK_PATH/bin/clang --verbose ../wasi-sdk/tests/general/mmap.c --target=wasm32-wasip2 --sysroot=./sysroot -lwasi-emulated-mman -D_WASI_EMULATED_MMAN -o mmap.wasm
clang version 19.1.5-wasi-sdk (https://github.com/llvm/llvm-project ab4b5a2db582958af1ee308a790cfdb42bd24720)
Target: wasm32-unknown-wasip2
Thread model: posix
InstalledDir: /home/tjc/wasi-sdk-25.0-x86_64-linux/bin
"/home/tjc/wasi-sdk-25.0-x86_64-linux/bin/clang-19" -cc1 -triple wasm32-unknown-wasip2 -emit-obj -dumpdir mmap.wasm- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mmap.c -mrelocation-model static -mframe-pointer=none -ffp-contract=on -fno-rounding-math -mconstructor-aliases -target-cpu generic -fvisibility=hidden -debugger-tuning=gdb -fdebug-compilation-dir=/home/tjc/wasi-libc -v -fcoverage-compilation-dir=/home/tjc/wasi-libc -resource-dir /home/tjc/wasi-sdk-25.0-x86_64-linux/lib/clang/19 -D _WASI_EMULATED_MMAN -isysroot ./sysroot -internal-isystem /home/tjc/was
[INFO] --- maven-javadoc-plugin:3.5.0:jar (attach-javadocs) @ core ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for International Components for Unicode for Java (icu4j-root) 76.0.1-SNAPSHOT:
[INFO]
[INFO] International Components for Unicode for Java (icu4j-root) SUCCESS [ 0.810 s]
[INFO] framework .......................................... SUCCESS [ 0.796 s]
[INFO] core ............................................... FAILURE [ 7.214 s]
[INFO] langdata ........................................... SKIPPED
[INFO] regiondata ......................................... SKIPPED
[INFO] currdata ........................................... SKIPPED
@catamorphism
catamorphism / gist:fc07f7eda8ae5dd9ec5da7448b57ce1c
Last active April 4, 2024 22:53
Crashes in ICU tools when running under asan
# Steps to reproduce
Using Ubuntu 23.10 and clang 16.0.6.
```
$ git clone https://github.com/unicode-org/icu.git
$ cd icu
$ mkdir build
$ cd build
$ CPPFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address ../icu4c/source/runConfigureICU --enable-debug --disable-release Linux/clang --disable-renaming --enable-tracing
```
ASAN_OPTIONS=detect_leaks=0
LD_LIBRARY_PATH=../lib:../stubdata:../tools/ctestfw:$LD_LIBRARY_PATH rr record ../bin/genrb -s ../../icu4c/source/data/locales -d ./out/build/icudt75l/ -i ./out/build/icudt75l --usePoolBundle ./out/build/icudt75l/ -k af.txt
LD_LIBRARY_PATH=../lib:../stubdata:../tools/ctestfw:$LD_LIBRARY_PATH rr record ../bin/genrb -s ../../icu4c/source/data/locales -d ./out/build/icudt75l/ -i ./out/build/icudt75l --usePoolBundle ./out/build/icudt75l/ -k af_NA.txt
LD_LIBRARY_PATH=../lib:../stubdata:../tools/ctestfw:$LD_LIBRARY_PATH rr record ../bin/genrb -s ../../icu4c/source/data/locales -d ./out/build/icudt75l/ -i ./out/build/icudt75l --usePoolBundle ./out/build/icudt75l/ -k af_ZA.txt
LD_LIBRARY_PATH=../lib:../stubdata:../tools/ctestfw:$LD_LIBRARY_PATH rr record ../bin/genrb -s ../../icu4c/source/data/locales -d ./out/build/icudt75l/ -i ./out/build/icudt75l --usePoolBundle ./out/build/icudt75l/ -k agq.txt
LD_LIBRARY_PATH=../lib:../stubdata:../tools/ctestfw:$LD_LIBRARY_PATH rr record ../bi
by tef ( http://twitter.com/tef_ebooks ) and Tim ( http://twitter.com/fatneckbeardguy )
I hear the BART a comin'
It's rollin' round the bend
And I haven't seen the sunshine
since I don't know when
I'm stuck in San Francisco
and time keeps dragging on
But that train keeps a rollin'
On down to Pleasantone
by tef ( http://twitter.com/tef_ebooks ) and Tim ( http://twitter.com/fatneckbeardguy )
I hear the BART a comin'
It's rollin' round the bend
And I haven't seen the sunshine
since I don't know when
I'm stuck in San Francisco
and time keeps dragging on
But that train keeps a rollin'
On down to Pleasantone
\documentclass{article}[12pt]
\usepackage{mathptmx}
\usepackage{newtxmath}
\begin{document}
{\fontsize{128}{60}\selectfont $\uplambda$}
\end{document}