Trying out Latin-Greek in C

This commit is contained in:
Jari Bakken 2010-05-14 16:17:34 +02:00
parent bb915d6871
commit 0bfc0bba81
3 changed files with 6 additions and 4 deletions

View File

@ -16,6 +16,8 @@ module ICU
ICU::Normalization.normalize("Å", :nfc).unpack("U*").should == [197]
end
# TODO: add more normalization tests
end
end # Normalization

View File

@ -13,8 +13,8 @@ module ICU
# after { @t.close if @t }
it "should transliterate Greek-Latin" do
transliterator("Greek-Latin").transliterate("Χελλο Ωορλδ").should == "Hello World"
it "should transliterate Latin-Greek" do
transliterator("Latin-Greek").transliterate("Hello World").should == "Χελλο Ωορλδ"
end
it "should transliterate Lower" do

4
test.c
View File

@ -22,14 +22,14 @@ int main (int argc, char const *argv[])
UTransliterator* trans = NULL;
UErrorCode status = U_ZERO_ERROR;
trans = utrans_open("Lower", UTRANS_FORWARD, NULL, 0, NULL, &status);
trans = utrans_open("Latin-Greek", UTRANS_FORWARD, NULL, 0, NULL, &status);
UChar from[256];
UChar buf[256];
int32_t text_length, limit;
u_uastrcpy(from, "ABC");
u_uastrcpy(from, "Hello World");
u_strcpy(buf, from);
limit = text_length = u_strlen(buf);