| 220 | } |
| 221 | |
| 222 | func UnitstrDecode(value string) string { |
| 223 | strconv.ParseInt(value, 10, 16) |
| 224 | results := make([]string, 0) |
| 225 | lens := len(value) |
| 226 | |
| 227 | for i := 0; i < lens; { |
| 228 | if value[i] != '\\' { |
| 229 | results = append(results, string(value[i])) |
| 230 | i += 1 |
| 231 | } else { |
| 232 | if lens >= (i + 4) { |
| 233 | // Read next 4 character hex and convert to character. |
| 234 | temp, err := strconv.ParseInt(string(value[i+1:i+5]), 16, 0) |
| 235 | if err != nil { |
| 236 | return "" |
| 237 | } |
| 238 | |
| 239 | results = append(results, fmt.Sprintf("%c", temp)) |
| 240 | i += 5 |
| 241 | continue |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | } |
| 246 | return strings.Join(results, "") |
| 247 | } |
| 248 | |
| 249 | func oracleTp2MySQLTp(td *oracle_ast.ColumnDef) *ast.ColumnDef { |
| 250 | columnName := IdentifierToString(td.ColumnName) |