lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Fwd: Help with unicode "REGISTERED SIGN"


From: Greg Chicares
Subject: [lmi] Fwd: Help with unicode "REGISTERED SIGN"
Date: Wed, 07 Oct 2015 13:56:13 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0

[resending because original was missing from html archive]


-------- Forwarded Message --------
Subject: [lmi] Help with unicode "REGISTERED SIGN"
Date: Thu, 01 Oct 2015 04:38:49 +0000
From: Greg Chicares <address@hidden>
Reply-To: Let me illustrate... <address@hidden>
To: Let me illustrate... <address@hidden>, Vadim Zeitlin <address@hidden>

[Copying Vadim again--sorry, mailing list remains sluggish.]

I really, really want a "short" product name that contains "REGISTERED SIGN".

When the short product name is rendered in the group-quote PDF, here:
    wxString const image_text
        (report_data_.short_product_
         + "\nPremium & Benefit Summary"
        );
I want: UL SUPREME®
I get:  UL SUPREME®
Probably if I say exactly what I'm doing you can spot my mistake.

In 'product_data.cpp':
    z.GroupQuoteShortProductName = glossed_string("UL SUPREME®");

grep --text SUPREME /lmi/src/lmi/product_data.cpp
    z.GroupQuoteShortProductName = glossed_string("UL SUPREME®");
grep --text SUPREME /lmi/src/lmi/product_data.cpp |od -t c
[the one line that matters:]
0000060   g   (   "   U   L       S   U   P   R   E   M   E 302 256   "

With 'od -t x2' that becomes
0000060 2867 5522 204c 5553 5250 4d45 c245 22ae
                                      ^^     ^^
which seems to match the expected UTF-8 "0xC2 0xAE".

That code generates this product file:

grep SUPREME /opt/lmi/data/sample.policy
    <datum>UL SUPREME&#xAE;</datum>

which looks good at first glance, but apparently "&#xAE;" there is not
an entity reference but instead literal characters { & # x A E }:

/home/earl[0]$grep SUPREME /opt/lmi/data/sample.policy |od -t c
0000000                   <   d   a   t   u   m   >   U   L       S   U
0000020   P   R   E   M   E   &   #   x   A   E   ;   <   /   d   a   t

Why? The product files are not HTML but XML, which doesn't reserve
"REGISTERED SIGN".

Anyway, on the group-quote PDF (which uses that product file) I see this:
$echo "UL SUPREME®" |od -t c
0000000   U   L       S   U   P   R   E   M   E 303 202 302 256  \n

Am I supposed to recognize "303 202", perhaps as some special escape?
Let's convert from octal:

OCT 303 202 302 256
DEC 195 130 194 174
HEX  C3  82  C2  AE

And 0xC3 0x82 is..."LATIN CAPITAL LETTER A WITH CIRCUMFLEX". Well, yes,
so I had discerned. How do I get rid of it?

_______________________________________________
lmi mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lmi





reply via email to

[Prev in Thread] Current Thread [Next in Thread]