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

Problem to get header content! #222

Open
dangdkhanh opened this issue Apr 3, 2024 · 1 comment · May be fixed by #247
Open

Problem to get header content! #222

dangdkhanh opened this issue Apr 3, 2024 · 1 comment · May be fixed by #247

Comments

@dangdkhanh
Copy link

Hi,

Please check the attached file.
The separator character is tab.
The third column header returns the wrong content.
Thanks you.

B.TXT

@dangdkhanh dangdkhanh changed the title Add support unicode for header! Problem to get header content! Apr 3, 2024
@dangdkhanh
Copy link
Author

Hi,
I realized the problem lies with the unicode characters that are at the beginning or end of each cell. will cause field_start and field_length calculations to be incorrect.
The temporary way I came up with is to use a variable that defines the boundary:

const BOOL checkboundary(char x) {
return x == '\t' || x == ',';
};
const auto& isbeginend = data_pos == 0 || (data_pos > 1 &&
((!checkboundary(this->data_ptr->data[data_pos]) && checkboundary(this->data_ptr->data[data_pos - 1])) ||
(!checkboundary(this->data_ptr->data[data_pos]) && data_pos < size - 1 && checkboundary(this->data_ptr->data[data_pos + 1]))));

From there recalculate the flag:

const auto& flag = compound_parse_flag(in[data_pos], isbeginend);

It may work in some cases but not completely.
B.TXT

@hirohira9119 hirohira9119 linked a pull request Oct 14, 2024 that will close this issue
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 a pull request may close this issue.

1 participant