Skip to content

Commit

Permalink
utf8 bug in build.R
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Feb 8, 2020
1 parent a9f6c31 commit e1ad473
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Description: Standardize country names, convert them into one of
assign region descriptors.
Version: 1.1.1
URL: https://github.com/vincentarelbundock/countrycode
Date: 2020-01-30
Date: 2020-02-08
Depends:
R (>= 2.10)
Suggests:
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version 1.1.1 (2020-01-30)
Version 1.1.1 (2020-02-08)
--------------------------

* Bug: Typo prevented users for using "p4n" as origin code
Expand Down
Binary file modified data/backup.rds
Binary file not shown.
Binary file modified data/codelist.rda
Binary file not shown.
Binary file modified data/codelist_panel.rda
Binary file not shown.
12 changes: 6 additions & 6 deletions dictionary/build.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ if (anyDuplicated(cs$country.name.en)) {
}

# Encoding: convert to UTF-8 if there are non-ASCII characters
for (col in colnames(codelist)[sapply(codelist, class) == 'character']) {
if (!all(na.omit(stringi::stri_enc_mark(codelist[[col]])) == 'ASCII')) {
codelist[[col]] <- enc2utf8(codelist[[col]])
for (col in colnames(cs)[sapply(cs, class) == 'character']) {
if (!all(na.omit(stringi::stri_enc_mark(cs[[col]])) == 'ASCII')) {
cs[[col]] <- enc2utf8(cs[[col]])
}
}
for (col in colnames(codelist_panel)[sapply(codelist_panel, class) == 'character']) {
if (!all(na.omit(stringi::stri_enc_mark(codelist_panel[[col]])) == 'ASCII')) {
codelist_panel[[col]] <- enc2utf8(codelist_panel[[col]])
for (col in colnames(panel)[sapply(panel, class) == 'character']) {
if (!all(na.omit(stringi::stri_enc_mark(panel[[col]])) == 'ASCII')) {
panel[[col]] <- enc2utf8(panel[[col]])
}
}

Expand Down
2 changes: 1 addition & 1 deletion dictionary/data_static.csv
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ Republic of Vietnam,(?!social).*republic.of.viet.?nam|south.viet.?nam|viet.?nam.
Wallis and Futuna,futuna|wallis,Wallis und Futuna,futuna|wallis,ASIA,Oceania,,Asia,Asia/Pacific,,Polynesia,Wallis and Futuna Islands,876
Western Sahara,western.sahara,Westsahara,westsahara,MAF,Africa,,Africa,Southern Africa,,Northern Africa,Western Sahara,732
Wuerttemburg,w(ue|ü)rttemburg,Württemberg,w(ue|ü)rttemberg,,,,,,,,,
Würtemberg,w.rtemberg,,,,,,,,,,,
Wurtemberg,w.rtemberg,,,,,,,,,,,
Yemen,^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\bp\.?d\.?r).*yemen,Jemen,^(?!.*arab)(?!.*nord)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*süd)(?!.*aden)(?!.*\bp\.?d\.?r).*jemen,MAF,Asia,,Middle East,Middle-East,474,Western Asia,Yemen,887
Yemen Arab Republic,^(?=.*arab).*yemen|^(?=.*north).*yemen|^(?=.*sana).*yemen,Jemenitische Arabische Republik,^(?=.*arab).*jemen|^(?=.*nord).*jemen|^(?=.*sana).*jemen,,,,,,,,,
Yemen People's Republic,^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\bp\.?d\.?r).*yemen,Demokratische Volksrepublik Jemen,^(?=.*volk).*jemen|^(?!.*rep)(?=.*dem).*jemen|^(?=.*süd).*jemen|^(?=.*aden).*jemen|^(?=.*\bp\.?d\.?r).*jemen,,,,,,,,,
Expand Down

0 comments on commit e1ad473

Please sign in to comment.