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

Answer data that contains only double-byte full-width characters cannot be imported. #731

Closed
6 tasks
FdaiJ opened this issue May 27, 2024 · 2 comments
Closed
6 tasks
Assignees
Labels

Comments

@FdaiJ
Copy link

FdaiJ commented May 27, 2024

Describe the bug
An error occurs when importing an Excel file containing answer data that is created using only double-byte full-width characters.

To Reproduce
An error occurs when importing an Excel file created with answer data using only Japanese full-width 2-byte characters.
Please import using the attached Excel file.
・Import results
QnABot.keyword1 to QnABot.keyword5 are NG
QnABot.keyword6 to QnABot.keyword10 are OK
・NG error message
Error Loading Content
Warning: No answer found for QID:"QnABot.keyword1". The question will be skipped.
Warning: No answer found for QID:"QnABot.keyword2". The question will be skipped.
Warning: No answer found for QID:"QnABot.keyword3". The question will be skipped.
Warning: No answer found for QID:"QnABot.keyword4". The question will be skipped.
Warning: No answer found for QID:"QnABot.keyword5". The question will be skipped.
・Difference between NG and OK
NG answer data contains only full-width 2-byte characters
OK answer data contains 1-byte characters

Expected behavior
You can import answer data containing only Japanese full-width 2-byte characters.

Please complete the following information about the solution:

To get the version of the solution, you can look at the description of the created CloudFormation stack. For example, "(SO0189) QnABot [...] v0.0.1".

  • Region: ap-northeast-1
  • Was the solution modified from the version published on this repository? No
  • If the answer to the previous question was yes, are the changes available on GitHub?
  • Have you checked your service quotas for the services this solution uses? Yes
  • Were there any errors in the CloudWatch Logs? No

Screenshots
If applicable, add screenshots to help explain your problem (please DO NOT include sensitive information).

Additional context
Add any other context about the problem here.

@FdaiJ FdaiJ added the bug label May 27, 2024
@fhoueto-amz
Copy link
Member

Thanks for reporting this, We will look into it.

@michaelin-96
Copy link
Member

Hi @FdaiJ,

This issue will be resolved in the next release.

However if you need to make changes to your local deployment to ingest double-byte characters, you can do the following:
Replace
if (!question.a || question.a.replace(/[^a-zA-Z0-9-_]/g, '').trim().length == 0) {
to
if (!question.a || question.a.replace(/\s/g, '').length == 0) {

In convert-xlsx.js (Ln 175) & import.vue (Ln 398 & 437). This will allow you to import xlsx & json with double-byte chars only.

Closing this ticket out. Thanks

This was referenced Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants