-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
locale.Error: unsupported locale setting in Python3.5.2 window7 #1
Comments
hi there, it seems there is an issue with your chinese locale settings. the script and the api require a UTF-8 compatible locale setting. i guess you are trying it out on your local desktop computer with windows, right? since i'm not a windows user since years i can`t give you a detailed instruction to set up a new locale in windows... perhaps you can add a new user that have a "en_US.UTF-8"-like locale? by the way... the api request in the script is configured for a german respond... if you are a beginner, that seems some damn good quests to solve for you. ;) read the api documentation for any details how to configure the request and the respond. the request-url is constructed in the Update.update_json()-function feel free to contact me, if you need more help. |
Oh... and please rename your folder to "WeatherPi_TFT"... don't know when you cloned the repo... i made some fixes with "sys.path[0]" for Folder-PATH in the last commits to solve variable folder names for that application... or just update the project via git or download again ;) |
@LoveBootCaptain ,thanks for your reply
i find that the X in locale.setlocale(locale.LC_ALL, X) must be 2 byte. 'mai' and 'univ' do not work. i dont konw why Then:
|
you can use in e.g.: i don't know what happen, if you uncomment this completely... i needed to use it to solve problems with strange characters like german umlauts (ä, ö, ü, ß), which come from the API (like in forecast-summary strings). long story short: be shure you set the API request to use english as language AND your os should be set up to here is an API request you can use (weather is from New York): you don't have to use API key from the json file. just overwrite the hole please do not share your secret keys ;) you can reset it in the account settings of https://darksky.net/dev/account your first json error looks like you probably missed the double quotes for the key or the value. just replace the xxxx with your API-key but not the " " ;) . it has to look this (no comma at the end -> i have to change that in the example):
hope this helps ;) just tried it on a fresh and new installed jessie-raspbian... it runs out of the box on a raspberry pi with latest raspbian image with english locale. |
Thanks for your suggestion! About json error ,i have found the key.Yesterday my json is:
now i remove the last ',' .and the code is working...... |
More options in config are already done, but not committed and pushed yet. I will update it later today.
Great that it works now. That means you fixed the locale issue? If yes, How?
|
About the setlocale .in the In the project,the code 'locale.setlocale(locale.LC_ALL, 'uk_UA.KOI8-U')' is not working |
ah great. it has to be a tuple in XX
|
In addition,when i use |
this could be cause the font don't has that special character... feel free to change the font to one which has that. it has to be in (i know this problems cause of the german umlauts (ä, ö, ü) too... hate those crazy umlauts like those commas i missed to remove in examples 😂 ) |
I use the |
if you find a font which looks good on the device or a Roboto-Chinese-Font feel free to add it via pull request. the equivalent of Roboto-Font in android and chrome is Noto-Font (https://material.io/guidelines/style/typography.html#typography-typeface), here is a link to google fonts: https://fonts.google.com/specimen/Noto+Sans?selection.family=Noto+Sans. perhaps the locale issue is related to os? who knows... in mac os and linux it works... on windows not... |
about the moon issue: the moon-phase is provided via API (and the Temp-Data too) which might be the difference. squix78 is using another API (wonderground). i use darksky (forecast.io). darksky is providing moonphase in a value which is percentage. my icons are 28 for 31 possible moonphases. i do a little math in i guess for 1% visible moon it is ok... for squix78 and my code 😂 1% is nearly unvisible. |
Please share a picture with chinese font if you get it working. |
let it snow let it snow let it snow p.s.: you should change the hardcoded "Schnee" for "snow" with a language that fits you. |
AHAHAH,global warming in 10+ years made the weather abnormal,In winter some parts of China are suffering form haze:( |
just pushed the updated config.json with more options... |
i have see the new config.json~
and :
Sure that modify the API lang to zh: |
looks crazy in chinese 🤣 great work a good translation of "Niederschlag" would be "rainfall" or "precipitation" please don't modify your last post... i will use it as a link for troubleshooting |
HI Guys, |
It just works as is! I assume you got API from https://www.weatherbit.io/. rest commands as straight forward. I am running on Pi 3 4 5 and both HDMI, DSI and hyperpixel LCDs. By the way are you able to boot up to PI desktop? |
Question to author / all the precipitation pulled and displayed is for DAILY - issue is if morning there is some% rain evening as well it shows DAILY PRECEPTATION % and ICON. Better I change it to CURRENT. Not able to do so. Let me know which line of code needs to be changed. |
Hi I'm trying for 4 days now to get it work. i've follw the steps for installation. got myself a api.key. and able te see the desktop. |
hi @LoveBootCaptain ,
i saw your project by twitter, and at the same i see this project here.i'm a beginner in python,too. So i try to build this project. And i encounter an error:
i dont know where is wrong.However,i annotate
return _setlocale(category, locale)
in "D:\Python35\lib\locale.py", line 594and the error is gone
But there is a new error:
i have no idea about it...
PS: i can get defaultlocale by
locale.getdefaultlocale()
:Do you have a idea?
The text was updated successfully, but these errors were encountered: