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

Typo in the intl/utils/mapgen4.c [CORE1374] #1792

Closed
firebird-automations opened this issue Jul 22, 2007 · 8 comments
Closed

Typo in the intl/utils/mapgen4.c [CORE1374] #1792

firebird-automations opened this issue Jul 22, 2007 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: morgan mo (morgan)

The tool mapgen4 can not generate the correct mapping table file. Check the source file intl/utils/mapgen4.c.
There is typo in it.

237 if (unicode < unicode_conversion.low_point)
238 unicode_conversion.low_point = unicode;
239 if (unicode > unicode_conversion.high_point)
240 codepoint_conversion.high_point = unicode;

the code at 240 line should be:
unicode_conversion.high_point = unicode;

Commits: cc99259 7599b49

@firebird-automations
Copy link
Collaborator Author

Commented by: morgan mo (morgan)

There is another typo .

199 /* Small tables print with all comments */
200 if ((unicode_conversion.count < 256) || (!option_condensed))
201 print_indexed_table("from_unicode", &unicode_conversion,
202 CANT_MAP_CHARACTER);
203 else
204 print_condensed_indexed_table("from_unicode", &unicode_conversion,
205 CANT_MAP_CHARACTER);

200 line should be:
if ((codepoint_conversion.count < 256) || (!option_condensed))

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.1 Beta 2 [ 10190 ]

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Morgan, nobody is using this utility...

Are you sure about the line 200?

Why it should be changed?

@firebird-automations
Copy link
Collaborator Author

Commented by: morgan mo (morgan)

yes, nobody use it. I just want learn how the mapping table file was created.
So I compiled the mapgen4.c, but I got a wrong mapping file by mapgen4. I suspected the utility. So I review its code.

Through mapgen4.c, only inceased codepoint_conversion.count and the unicode_conversion.count not changed. We know codepoint_conversion.count should be equel to unicode_conversion.count(codepoint_conversion is codepoint-->unicode and unicode_conversion is unicode-->codepoint). So we can change the code as above.

I use gb2312.txt to test my modify. Yes , after modified, mapgen4 output the correct result that as same as intl\charsets\cs_gb2312.h

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 12650 ] => Firebird [ 14233 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Cannot be tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants