Skip to content

Commit fb126bd

Browse files
authored
Merge pull request #148 from ciatph/dev
v1.4.5
2 parents c6f5f16 + b9d3eb7 commit fb126bd

File tree

7 files changed

+216
-300
lines changed

7 files changed

+216
-300
lines changed

README.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,11 @@ The following dependencies are used to build and run the image. Please feel feel
354354
355355
3. Build and run the app using Docker.
356356
- Build<br>
357-
`docker compose -f docker-compose.dev.yml build`
357+
`docker compose build`
358358
- Run<br>
359-
`docker compose -f docker-compose.dev.yml up`
359+
`docker compose up`
360360
- Stop<br>
361-
`docker compose -f docker-compose.dev.yml down`
361+
`docker compose down`
362362
363363
4. Edit and execute scripts within the running docker container from **step #3**.
364364
- For running NPM scripts (see the [Available Scripts](#available-scripts) section for more information):<br>
@@ -530,6 +530,10 @@ Run tests defined in the `/app/__tests__` directory.
530530
- Downloads and parses a remote excel file.
531531
- Demonstrates sample usage with `await`
532532

533+
### `npm run debug`
534+
535+
- Runs the `npm run list:region` with `--inspect` mode for debugging in containers.
536+
533537
</details>
534538

535539
<br>
@@ -920,6 +924,32 @@ This section describes several common errors and related fixes.
920924

921925
</details>
922926

927+
<details>
928+
<summary style="font-size: 18px;">
929+
<b>Malformed text characters in the municipality names</b>
930+
</summary>
931+
932+
#### Information
933+
934+
- Sometimes, garbled or malformed text like `"├â┬▒"`, `"ñ"`, and others are present in the PAGASA 10-Day Weather forecast Excel files.
935+
- This usually occurs when there is a character encoding mismatch when writing data in `UTF-8` format in Excel files, but the ph-municipalities scripts (or Microsoft Excel, Notepad or other programs) interpret it as `ANSI` (Windows-1252) or some other encoding.
936+
937+
#### Fix
938+
939+
Convert the malformed text to its original text counterparts.
940+
941+
1. Add the malformed characters and their expected character conversions in the `SPECIAL_CHARACTERS` env variable as pipe-delimited key-value pairs.
942+
2. For example, the `"├â┬▒"` and `"ñ"` actually translate to the `"ñ"` character. Write them in the `SPECIAL_CHARACTERS` variable as:<br>
943+
```
944+
SPECIAL_CHARACTERS=├â┬▒:ñ,ñ:ñ
945+
```
946+
3. Add a blank space after the `":"` character if the malformed text does not have any conversion.<br>
947+
```
948+
SPECIAL_CHARACTERS=├â┬▒:ñ,ñ:ñ,â:
949+
```
950+
951+
</details>
952+
923953
<br>
924954

925955
@ciatph<br>

app/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ EXCEL_FILE_URL=https://pubfiles.pagasa.dost.gov.ph/pagasaweb/files/climate/tenda
22
DEFAULT_EXCEL_FILE_URL=https://pubfiles.pagasa.dost.gov.ph/pagasaweb/files/climate/tendayweatheroutlook/day1.xlsx
33
SHEETJS_COLUMN=__EMPTY
44
SORT_ALPHABETICAL=1
5-
SPECIAL_CHARACTERS=├â┬▒:ñ,â:
5+
SPECIAL_CHARACTERS=├â┬▒:ñ,â:,ñ:ñ
66
IMAGE_URL=https://raw.githubusercontent.com/ciatph/ph-municipalities/master/docs/diagrams/ph-municipalities-arch-90.png

app/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
verbose: true,
3-
testTimeout: 20000,
3+
testTimeout: 30000,
44
moduleFileExtensions: ['js'],
55
testPathIgnorePatterns: [
66
'/node_modules/',

0 commit comments

Comments
 (0)