Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add character encoding conversion function #178

Merged
merged 2 commits into from
Jun 1, 2024

Conversation

psi59
Copy link
Contributor

@psi59 psi59 commented Jun 1, 2024

First, I apologize for the omission of test code in PR #176.
In this PR, I have added test code. I used for testing is Firebird SS 2.5.

Changes

  • Add a function to convert a given string to a specified character encoding
  • Support various target character encodings (e.g., UTF-8, EUC-KR)

psi59 added 2 commits June 1, 2024 20:30
- Add a function to convert a given string to a specified character encoding
- Support various target character encodings (e.g., UTF-8, EUC-KR)
@@ -310,122 +310,118 @@ func (x *xSQLVAR) parseString(raw_value []byte, charset string) interface{} {
if x.sqlsubtype == 1 { // OCTETS
return raw_value
}
if x.sqlsubtype == 0 {
Copy link
Contributor Author

@psi59 psi59 Jun 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I queried using the attached query, I confirmed that the subtype is 0, but the value of x.sqlsubtype set through the _parse_select_items function was found to be 44. Please check if it's my mistake.

Additionally, is the content of the linked documentation about subtype in Firebird correct?

SELECT REL_FIELDS.RDB$FIELD_NAME, FIELD_SPEC.RDB$FIELD_SUB_TYPE
FROM RDB$FIELDS FIELD_SPEC,
     RDB$RELATION_FIELDS REL_FIELDS
WHERE FIELD_SPEC.RDB$FIELD_NAME = REL_FIELDS.RDB$FIELD_SOURCE
  AND REL_FIELDS.RDB$RELATION_NAME = 'T'
  AND REL_FIELDS.RDB$FIELD_NAME = 'TEXT';

@nakagami
Copy link
Owner

nakagami commented Jun 1, 2024

Thanks

It really looks okay!

@nakagami nakagami merged commit b63155f into nakagami:master Jun 1, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants