| 85 | |
| 86 | |
| 87 | string IntlUtil::generateSpecificAttributes(Jrd::CharSet* cs, SpecificAttributesMap& map) |
| 88 | { |
| 89 | SpecificAttributesMap::Accessor accessor(&map); |
| 90 | |
| 91 | bool found = accessor.getFirst(); |
| 92 | string s; |
| 93 | |
| 94 | while (found) |
| 95 | { |
| 96 | UCHAR c[sizeof(ULONG)]; |
| 97 | ULONG size; |
| 98 | |
| 99 | SpecificAttribute* attribute = accessor.current(); |
| 100 | |
| 101 | s += escapeAttribute(cs, attribute->first); |
| 102 | |
| 103 | const USHORT equalChar = '='; |
| 104 | |
| 105 | size = cs->getConvFromUnicode().convert( |
| 106 | sizeof(equalChar), (const UCHAR*) &equalChar, sizeof(c), c); |
| 107 | |
| 108 | s.append((const char*) &c, size); |
| 109 | |
| 110 | s += escapeAttribute(cs, attribute->second); |
| 111 | |
| 112 | found = accessor.getNext(); |
| 113 | |
| 114 | if (found) |
| 115 | { |
| 116 | const USHORT semiColonChar = ';'; |
| 117 | size = cs->getConvFromUnicode().convert( |
| 118 | sizeof(semiColonChar), (const UCHAR*) &semiColonChar, sizeof(c), c); |
| 119 | |
| 120 | s.append((const char*) &c, size); |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | return s; |
| 125 | } |
| 126 | |
| 127 | |
| 128 | bool IntlUtil::parseSpecificAttributes(Jrd::CharSet* cs, ULONG len, const UCHAR* s, |