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

Correct currency info for "Israeli new shekel" #744

Closed
2 tasks done
gitys opened this issue Mar 3, 2016 · 13 comments
Closed
2 tasks done

Correct currency info for "Israeli new shekel" #744

gitys opened this issue Mar 3, 2016 · 13 comments
Assignees

Comments

@gitys
Copy link
Contributor

gitys commented Mar 3, 2016

  • windows
  • 1.3.0 alpha

Opening this ticket following Vomikan's instruction from PR #740

There are two fixes that are required to "Israeli new shekel"

  1. Change name: use "Shekel" not "Sheqel"
  2. Add symbol: symbol is ₪ (\u20AA)
    .
@vomikan
Copy link
Member

vomikan commented Mar 3, 2016

Related issue: #739

@gitys
Copy link
Contributor Author

gitys commented Mar 7, 2016

I'm a bit confused now since this fix looks very similar to my fix PR #740 that was rejected by @vomikan
In any case, I think placing the unicode char in the source file is problematic. At least in visual studio I got a warning about this, and indeed when opening the currency dialog, the symbol was gibberish. Has this worked for you on windows? Using \u20AA worked for me.

@vomikan
Copy link
Member

vomikan commented Mar 7, 2016

I'm a bit confused as well.

2016-03-08 0:48 GMT+03:00 yshatsky notifications@github.com:

I'm a bit confused now since this fix looks very similar to my fix PR #740
#740 that was
rejected by @vomikan https://github.com/vomikan
In any case, I think placing the unicode char in the source file is
problematic. At least in visual studio I got a warning about this, and
indeed when opening the currency dialog, the symbol was gibberish. Has this
worked for you on windows? Using \u20AA worked for me.


Reply to this email directly or view it on GitHub
#744 (comment)
.

@guanlisheng
Copy link
Contributor

the major difference is that my patch generated from database repo

@stef145g
Copy link
Contributor

stef145g commented Mar 8, 2016

@gitys The changes made to the DB_TABLE_xxx.h would have been destroyed when the database schema was updated.
Refer to PR: stef145g@0e1e784
This should help explain the process.

@gitys
Copy link
Contributor Author

gitys commented Mar 9, 2016

Hi @stef145g
Thank you for that link!

  1. I think I might still be missing something though. Based on the link and base on @vomikan's comment from fix(currency): correct currency info for "Israeli new shekel" #740, I would expect the commit to include a change to tables_v1.sql. Looking in this file, the currency info has not been updated:
    INSERT INTO "CURRENCYFORMATS_V1" VALUES(71,'Israeli new sheqel','','','.',' ','','',100,1,'ILS');
    Can you please explain that to me?
  2. Referring back to my comment above regarding unicode in source files. I now tested this in visual studio and it doesn't work. I created a new DB, in the wizard I clicked "set currency", selected ILS and pressed "edit". The currency displayed is gibberish (see attached screenshot). A solution I found was to enter "\u20AA" instead of the '₪' unicode character.

bad currency symbol

Thanks,

@stef145g
Copy link
Contributor

@gitys

I would expect the commit to include a change to tables_v1.sql. Looking in this file, the currency info has not been updated:

The change and push is actually done in the submodule: database. Once you have executed a
git.exe pull -v --progress "upstream" you must also do a
git.exe submodule update --init
( Personally I use Windows and TortoiseGit. I extracted the git commands from TortoiseGit for explanation)

If you treat the submodule database like a regular Git repository, you can show the Git log of database, where you will actually see the appropriate commit.

The file tables_v1.sql should now show the correct database schema. Regenerating the files will produce the required output in code. This file can also be tested, using an external program, to create a new database, and then import and execute the file as sql commands.

The Unicode character used in the file is correct according to http://unicode-table.com/en/#20AA ( ₪ )
You are correct that Visual studio does not interpret the Unicode character correctly in code. Using "\u20AA" produced a ? with compiler warnings about this Unicode character. I am not sure how to overcome this visual studio problem, but you can use MMEX to select the currency and insert the correct Unicode character manually.

@gitys
Copy link
Contributor Author

gitys commented Mar 10, 2016

@stef145g

  1. Thanks for that explanation. I updated submodules as you instructed and indeed I see the changes in tables_v1.sql
  2. It is a bit strange that what you are describing is what I am getting when I have the ₪ symbol in the code. But for me using "\u20AA" works perfectly. I updated tables_v1.sql
    INSERT INTO CURRENCYFORMATS_V1 VALUES(71,'Israeli new shekel','\u20AA','','.',' ','','',100,1,'ILS');
    Ran build_db_tables.bat and build_db_upgrade.bat, confirmed that DB_Table_Currencyformats_V1.h was updated:
    db->ExecuteUpdate(wxString::Format("INSERT INTO CURRENCYFORMATS_V1 VALUES (71, '%s', '%s', '%s', '%s', '%s', '%s', '%s', 100, 1, '%s')", wxTRANSLATE("Israeli new shekel"), wxTRANSLATE("\u20AA"), wxTRANSLATE(""), wxTRANSLATE("."), wxTRANSLATE(" "), wxTRANSLATE(""), wxTRANSLATE(""), wxTRANSLATE("ILS")));
    I have no compile errors and the character is displayed properly:
    ils symbol
    Are we doing the same thing here?

@guanlisheng guanlisheng reopened this Mar 11, 2016
@guanlisheng
Copy link
Contributor

@stef145g would you help here to reproduce the issue in windows platform?

@stef145g
Copy link
Contributor

I have tried this using Win7 & msvc,2013, Win10, msvc.2013, and msvc.2015 and I could not get the correct Unicode characters.

I have now discovered that using , L"\u20AA" or wxTRANSLATE(L"\u20AA") will return the correct Unicode character. In my opinion, wxTRANSLATE(...) is not needed in this case.

  • The table_v1.sql file needs the Unicode symbol: '₪'
  • The code generated from table_v1.sql needs L"\u20AA" being the Unicode representation.

The problem now becomes:
How to get the correct unicode character stored in the database using both code and direct sql entry?

This problem is not unique to this currency as it also affects other currencies.
Example: Pound, and Euro symbols.

@vomikan
Copy link
Member

vomikan commented Mar 12, 2016

Related issue #739

@guanlisheng
Copy link
Contributor

@stef145g @vomikan would you mind have a try on

wxPrintf

@vomikan
Copy link
Member

vomikan commented Mar 15, 2016

Let's continue with #739

@vomikan vomikan closed this as completed Mar 15, 2016
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

No branches or pull requests

4 participants