From owner-freebsd-hackers@freebsd.org Fri Feb 16 11:09:39 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C8E1F08385 for ; Fri, 16 Feb 2018 11:09:39 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: from mail-oi0-x236.google.com (mail-oi0-x236.google.com [IPv6:2607:f8b0:4003:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8884735BD for ; Fri, 16 Feb 2018 11:09:38 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: by mail-oi0-x236.google.com with SMTP id 8so2014981oix.7 for ; Fri, 16 Feb 2018 03:09:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=ib24Y2Sav/FYo7VlEwhjOfnoIa3Pmamu5vUH3OsBfzY=; b=oHHnWE2HZHT4PbpZQEz8iJXAPVSnXs6RNi9CJ7VCLHpxSQJ5mYBFHogC19sbLnKayH 5eFBRTaRuwa8Pt0L4H81wqe1/KlOl/zRhS2OFxjx8dI4weuQvdz+6VfOF6otRwQB/Z2c xD0UOUvr0tADWQkugjI3ytVWAm8G5koOSx6wou/L9vYf++Jwyw/MrE591lF+4Egsojaz vKzU2kcZ6KKeoE8Kxci55YrY1JvEdOpFAbrbmXHerBqvzDd7vwVjTvhFDcnyZdH9I5oA nvgjOIkxbJ+R9aayJxOXPWxMT+oHzjHfPaJYISykfMACEi85fuXfr63pDNR6EACKPu0q eIKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ib24Y2Sav/FYo7VlEwhjOfnoIa3Pmamu5vUH3OsBfzY=; b=N4/SB3OZNAJB6gD4+sY/dNlcJRlFQSTSOT4+rvLQnIIHMCIQWt8f9YyuD9usilxphs yai4U2hjnR8jG0Qit6104z6gLUytSrieNsAdDUqmw8xIG+ZBBk1CuaP1x+P3SqmtIPTR x0Rj9sOjFT+LrLstdbBlq5GwN/hHywUoK0ewT6u6B5kTiVIj3OPue6EzDjBJqKqUAxXr XEhKg5ia+m0QfGQJNBrPJcbbq9pzxmmsaAuWFO1YYFh/1Lp1Tz7Q4xvFaxl2ThaZWjYV I70WQ2DNz2rKJMW5eyb7Mk1+8voUnUMwKgcoPn5EQ5WHks5CH4lVQsmRGZZKt6YkiXSr krYQ== X-Gm-Message-State: APf1xPDwBrphPDgtFrLwAQ3sCrWxfPJzLsyYWetRR10MPk8DoRhZrIjp 1Q/sj/r4aKqCNTmckexmrcmJXWdXLx/QnBdnKS8= X-Google-Smtp-Source: AH8x227QIv6/6YTkjbIgs26LHaBtK14HejjtItz+2L6BXwc/9SDuL/aC6oG+0Ik858b+GBWP6kGwO/d7Z7KzYqaCiXU= X-Received: by 10.202.243.84 with SMTP id r81mr3842527oih.5.1518779378047; Fri, 16 Feb 2018 03:09:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.6.77 with HTTP; Fri, 16 Feb 2018 03:08:57 -0800 (PST) From: Lee D Date: Fri, 16 Feb 2018 06:08:57 -0500 Message-ID: Subject: How to set various locales with setlocale()? To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 11:09:39 -0000 Hi, I have a C program that needs to print the date in the correct form for the appropriate locale. Unfortunately, setlocale() will not accept any of the locale names in /usr/share/locale/, (which is documented in the man page for setlocale()). This is an embedded program running on custom arm hardware, not a normal user system, so I am trying to do everything from within the C program. Setting an environment variable and rebooting would be cumbersome. Do you folks have any suggestions on how to accomplish this goal, or how to make setlocale accept the locales listed on the system? Thanks.