- int len = string.length(),
- idx = 0,
- outidx = 0,
- Gtriplet = 0,
- nat_opts = (m_subtitle_page.m_C & (1<<14) ? 1 : 0) |
- (m_subtitle_page.m_C & (1<<13) ? 2 : 0) |
- (m_subtitle_page.m_C & (1<<12) ? 4 : 0),
- nat_subset = NationalOptionSubsetsLookup[Gtriplet*8+nat_opts];
-/* eDebug("nat_opts = %d, nat_subset = %d, C121314 = %d%d%d, m_C %08x",
- nat_opts, nat_subset,
- (m_subtitle_page.m_C & (1<<12))?1:0,
- (m_subtitle_page.m_C & (1<<13))?1:0,
- (m_subtitle_page.m_C & (1<<14))?1:0,
- m_subtitle_page.m_C); */
- while (idx < len)
- {
- unsigned char c = string[idx];
- if (c >= 0x20)
- {
- unsigned char offs = NationalReplaceMap[c];
- if (offs)
- {
- unsigned int utf8_code =
- NationalOptionSubsets[nat_subset*14+offs];
- if (utf8_code > 0xFFFFFF)
- out[outidx++]=(utf8_code&0xFF000000)>>24;
- if (utf8_code > 0xFFFF)
- out[outidx++]=(utf8_code&0xFF0000)>>16;
- if (utf8_code > 0xFF)
- out[outidx++]=(utf8_code&0xFF00)>>8;
- out[outidx++]=utf8_code&0xFF;
- }
- else
- out[outidx++] = c;
- }
- ++idx;
- }
-